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?
Shane - 29 Nov 2005 05:40 GMT
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.
> Because of my CSS selectors, I need to maintain the "id" attribute's
> value for a server control. The control is as follows:
[quoted text clipped - 11 lines]
> effect. How do I maintain the value of the "id" attribute in the
> browser so my CSS works?