Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Garrett Fisher 341 posts 496 karma points
    Jan 26, 2010 @ 18:03
    Garrett Fisher
    0

    Creative Website Starter: Search Field & Submit Button written differently on Results Page

    Hi,

    I am having an issue using the CWS_Search whereby the search field & submit button are being written with DIFFERENT ID's on the results page.  For example, when I'm on any other page of the site, the search field is ID'd:

    ctl00_ctl00_ContentPlaceHolderDefault_SearchBox_3_searchText

    Then on the results page, after the form is submitted, I get:

    ctl00_ctl00_ctl00_ContentPlaceHolderDefault_SearchBox_3_searchText

    As you can see, there is an extra "ctl00_" in front of it.  Why is this?  I shouldn't have to duplicate my CSS selectors just to style/position this.  Since these fields are dynamically named, I don't know how I can affect this.  Can I??  Where/how?

    Thanks,

    Garrett

  • Seth Niemuth 275 posts 397 karma points
    Jan 26, 2010 @ 18:12
    Seth Niemuth
    0

    Could you not just specify a CssClass for the text Box, which shouldn't change and then you can reference it from that such as:

    <asp:TextBox CssClass="searchBox3" runat="server" id="SearchBox_3_searchText" />

    Then in your stylesheet:

    .searchBox3

    {

    /*styles*/

    }

  • Garrett Fisher 341 posts 496 karma points
    Jan 26, 2010 @ 19:59
    Garrett Fisher
    0

    I can ABSOLUTELY do that, yes!  Thanks-- I just didn't know the "CssClass" attribute ;)  Brilliant.  Much appreciated.

    //Garrett

Please Sign in or register to post replies

Write your reply to:

Draft