Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Controls / November 2005

Tip: Looking for answers? Try searching our database.

Maintaining "id" attribute value in server controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
markarichman@gmail.com - 27 Nov 2005 11:47 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.