|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Maintaining "id" attribute value in server controlsBecause of my CSS selectors, I need to maintain the "id" attribute's
value for a server control. The control is as follows: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="NavControl.ascx.cs" Inherits="NavControl" %> <ul id="nav" runat="server"> <li>...</li> <li>...</li> <li>...</li> </ul> Upon rendering, the value of <ul id="nav"> becomes <ul id="ctl00_NavControl1_nav">. Setting nav.ID in code-behind has no effect. How do I maintain the value of the "id" attribute in the browser so my CSS works? I don't have the specific answer for you, but I have had to use the
"ClientID" property recently to write some javascript at the server and access a server based control. Show quoteHide quote "markarich***@gmail.com" wrote: > Because of my CSS selectors, I need to maintain the "id" attribute's > value for a server control. The control is as follows: > > <%@ Control Language="C#" AutoEventWireup="true" > CodeFile="NavControl.ascx.cs" Inherits="NavControl" %> > <ul id="nav" runat="server"> > <li>...</li> > <li>...</li> > <li>...</li> > </ul> > > Upon rendering, the value of <ul id="nav"> becomes <ul > id="ctl00_NavControl1_nav">. Setting nav.ID in code-behind has no > effect. How do I maintain the value of the "id" attribute in the > browser so my CSS works? > >
custom control client values gone with postback
Cool Web Parts? Server Control - object not saved when button clicked Setting focus to TextBox Problems with Custom Web Controls in VS 2005 Mouseover, mouseout, click etc on datagrid. DataList Issue DropDownList Value What is the Equivalent of the CurrentRowIndex Property for a DataGrid Web Control? Time textbox control |
|||||||||||||||||||||||