Design and CSS styles
Version 3.x > Design and CSS styles > Search style sheet doesn't work View modes: 
User avatar
Member
Member
romeo_osma-yahoo - 9/22/2008 3:17:18 AM
   
Search style sheet doesn't work
Hi Kentico team,

I was wondering why my classes doesn't apply on my search box, here's what I did was I edited this file from, ~\CMSWebParts\Search\cmssearchbox.ascx then included cssClass on each item: hidden, searchtext & searchbutton

<asp:Label ID="lblSearch" runat="server" AssociatedControlID="txtWord" CssClass="hidden" />
<asp:TextBox ID="txtWord" runat="server" CssClass="searchtext" />
<asp:Button ID="btnGo" runat="server" OnClick="btnGo_Click" CssClass="searchbutton" />

But when I load the page here's the script it generated:

<div class="searchbox" > <div id="ctl00_cmssearchboxNVIC1_pnlSearch" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_cmssearchboxNVIC1_btnImageButton')">

<label for="ctl00_cmssearchboxNVIC1_txtWord" id="ctl00_cmssearchboxNVIC1_lblSearch">Search:</label>
<input name="ctl00$cmssearchboxNVIC1$txtWord" type="text" id="ctl00_cmssearchboxNVIC1_txtWord" />

<input type="image" name="ctl00$cmssearchboxNVIC1$btnImageButton" id="ctl00_cmssearchboxNVIC1_btnImageButton" src="/CMSTemplates/NVIC/images/SearchBtn.jpg" style="border-width:0px;" />

</div>

and all the css class I had included was gone, I also tried recreating cmssearchbox.ascx in to a new file but the same thing happens.

Help please.

Best Regards,
Romeo Osma
Web Designer, Techstars.NET

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 9/22/2008 3:38:41 AM
   
RE:Search style sheet doesn't work
Hi Romeo,

You could change the css class of these parts in web part properties of Search box in design tab if you are using a Portal engine (Search button CSS class, Search label CSS class, Search textbox CSS class).

If you prefer an ASPX templates, please change the Search box control like this:

<uc2:cmssearchbox ID="Cmssearchbox1" runat="server" SearchButtonCssClass="searchbutton" SearchLabelCssClass="hidden" SearchTextboxCssClass="searchtext" />

These settings are „stronger“ than you have used, that is why it has not worked in your example.

Thank you.

Best regards,
Helena Grulichova