M
markarichman
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?
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?