Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Server Side Control ID's

Reply
Thread Tools

Server Side Control ID's

 
 
Lloyd Burley via .NET 247
Guest
Posts: n/a
 
      06-05-2004
Hoping someone here can help me.

I'm trying to change the ID that gets rendered to the browser for a
server side control

Example:

<aspanel id="Panel5" runat="server">test</aspanel>

Renders as:

<div
id="_PageTemplate0_innerHolder__PageTemplate7_Prof ileOptions_Panel5">t
est</div>

what I'd like to do is change the ID of the div or any other control
back to it's original value(possibly using the ClientID attribute?),
in this case Panel5. I would like this to happen ONLY if i haven't
set a cssclass on the control, that way I can track which I know to
be unique controls to a page and which aren't.

I would like to use this method for 2 reasons.
1. I use the ID's of controls for CSS layout of unique controls and
classes for non-unique controls.
2. I use a nested control template architecture which is a few levels
deep, as can can probably see, the ID that is output to the browser
is ugly and bloated and not in the spirit of the clean HTML I and my
company try to employ.

If anyone can help me out with this I'd be grateful

--------------------------------
From: Lloyd Burley

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>krGMkgpwrEaal2sq+LvvOQ==</Id>
 
Reply With Quote
 
 
 
 
Robert Koritnik
Guest
Posts: n/a
 
      06-07-2004
Don't use Panel webcontrol. Use something else. Lets say maybe you should
create some Literal control and you have complete cntrol over its rendering.

the thing why CLR changes to ClientID is that it assures uniqueness of the
IDs on the page.

But beside that you should find some other more usable way to achieve your
goal. Not with ID changes...

--
RobertK
{ Clever? No just smart. }

"Lloyd Burley via .NET 247" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Hoping someone here can help me.
>
> I'm trying to change the ID that gets rendered to the browser for a
> server side control
>
> Example:
>
> <aspanel id="Panel5" runat="server">test</aspanel>
>
> Renders as:
>
> <div
> id="_PageTemplate0_innerHolder__PageTemplate7_Prof ileOptions_Panel5">t
> est</div>
>
> what I'd like to do is change the ID of the div or any other control
> back to it's original value(possibly using the ClientID attribute?),
> in this case Panel5. I would like this to happen ONLY if i haven't
> set a cssclass on the control, that way I can track which I know to
> be unique controls to a page and which aren't.
>
> I would like to use this method for 2 reasons.
> 1. I use the ID's of controls for CSS layout of unique controls and
> classes for non-unique controls.
> 2. I use a nested control template architecture which is a few levels
> deep, as can can probably see, the ID that is output to the browser
> is ugly and bloated and not in the spirit of the clean HTML I and my
> company try to employ.
>
> If anyone can help me out with this I'd be grateful
>
> --------------------------------
> From: Lloyd Burley
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
>
> <Id>krGMkgpwrEaal2sq+LvvOQ==</Id>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server side control that maintains viewstate for client-side javascript variables? Keithb ASP .Net 1 02-26-2007 06:19 PM
Server-Side Control - Embedded Server-Side Code - Inline Mythran ASP .Net 2 01-22-2005 01:02 AM
Problem in adding template of server side control using client side scripts Lau Lei Cheong ASP .Net 1 10-13-2004 10:41 AM
Client-Side and Server-Side Control Ogre ASP .Net Web Controls 4 04-29-2004 12:44 PM
Reading Select control from server side which was modified on the client side Azmarae ASP .Net 1 03-03-2004 08:06 PM



Advertisments