Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Override INamingContainer

Reply
Thread Tools

Override INamingContainer

 
 
PJ
Guest
Posts: n/a
 
      12-21-2005
Is there a way to prevent the INamingContainer behaviour that prefixes the
id of server controls in master pages with the format [master page
id]_[content id]_. I would prefer to manage the potential id attribute
conflicts myself, rather than having such verbose id attributes throughout
my site.

Thanks,
~PJ


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      12-21-2005
The problem is that you don't know what some other control will emit for
an ID. I imagine what your problem is is that you want to hard code the ID
in your javascript to a well known value. Instead of hard coding, the approach
is to dynamically emit your javascript with the proper ID using the Control.ClientID
property.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Is there a way to prevent the INamingContainer behaviour that prefixes
> the id of server controls in master pages with the format [master page
> id]_[content id]_. I would prefer to manage the potential id
> attribute conflicts myself, rather than having such verbose id
> attributes throughout my site.
>
> Thanks,
> ~PJ



 
Reply With Quote
 
PJ
Guest
Posts: n/a
 
      12-21-2005
The id is known, one can set the id on the master page, content place holder
controls, etc. The pattern is always the same. I know what the final
rendered id value will be and can set the proper css/javascript selectors
properly ahead of time.

My problem is simply not having total control of the rendered id attributes
and the verbosity of the rendered values.


"Brock Allen" <> wrote in message
news: .com...
> The problem is that you don't know what some other control will emit for
> an ID. I imagine what your problem is is that you want to hard code the ID
> in your javascript to a well known value. Instead of hard coding, the

approach
> is to dynamically emit your javascript with the proper ID using the

Control.ClientID
> property.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
> > Is there a way to prevent the INamingContainer behaviour that prefixes
> > the id of server controls in master pages with the format [master page
> > id]_[content id]_. I would prefer to manage the potential id
> > attribute conflicts myself, rather than having such verbose id
> > attributes throughout my site.
> >
> > Thanks,
> > ~PJ

>
>



 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      12-21-2005
Sure, of course you can make it work. I think what I was trying to say is
that the pattern is what's documented to potentially change in the future,
thus the preference to use the ClientID property and merge that dynamically
into your javascript.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> The id is known, one can set the id on the master page, content place
> holder controls, etc. The pattern is always the same. I know what
> the final rendered id value will be and can set the proper
> css/javascript selectors properly ahead of time.
>
> My problem is simply not having total control of the rendered id
> attributes and the verbosity of the rendered values.
>
> "Brock Allen" <> wrote in message
> news: .com...
>
>> The problem is that you don't know what some other control will emit
>> for an ID. I imagine what your problem is is that you want to hard
>> code the ID in your javascript to a well known value. Instead of hard
>> coding, the
>>

> approach
>
>> is to dynamically emit your javascript with the proper ID using the
>>

> Control.ClientID
>
>> property.
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> Is there a way to prevent the INamingContainer behaviour that
>>> prefixes the id of server controls in master pages with the format
>>> [master page id]_[content id]_. I would prefer to manage the
>>> potential id attribute conflicts myself, rather than having such
>>> verbose id attributes throughout my site.
>>>
>>> Thanks,
>>> ~PJ



 
Reply With Quote
 
PJ
Guest
Posts: n/a
 
      12-22-2005
You're seriously are recommending dynamically generating .js files based on
the prospect that the next version of asp.net might change their rendering
of id attributes?

Insane man...

"Brock Allen" <> wrote in message
news: .com...
> Sure, of course you can make it work. I think what I was trying to say is
> that the pattern is what's documented to potentially change in the future,
> thus the preference to use the ClientID property and merge that
> dynamically into your javascript.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>> The id is known, one can set the id on the master page, content place
>> holder controls, etc. The pattern is always the same. I know what
>> the final rendered id value will be and can set the proper
>> css/javascript selectors properly ahead of time.
>>
>> My problem is simply not having total control of the rendered id
>> attributes and the verbosity of the rendered values.
>>
>> "Brock Allen" <> wrote in message
>> news: .com...
>>
>>> The problem is that you don't know what some other control will emit
>>> for an ID. I imagine what your problem is is that you want to hard
>>> code the ID in your javascript to a well known value. Instead of hard
>>> coding, the
>>>

>> approach
>>
>>> is to dynamically emit your javascript with the proper ID using the
>>>

>> Control.ClientID
>>
>>> property.
>>>
>>> -Brock
>>> DevelopMentor
>>> http://staff.develop.com/ballen
>>>> Is there a way to prevent the INamingContainer behaviour that
>>>> prefixes the id of server controls in master pages with the format
>>>> [master page id]_[content id]_. I would prefer to manage the
>>>> potential id attribute conflicts myself, rather than having such
>>>> verbose id attributes throughout my site.
>>>>
>>>> Thanks,
>>>> ~PJ

>
>



 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      12-22-2005
Not insane; I'm simply suggesting the documented way for identifying the
ID of controls in the client. This was the documented was of doing things
in ASP.NET v1.0 and if one had followed those guildlines originally then
one's code would work going forward in v1.1 and v2.0.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> You're seriously are recommending dynamically generating .js files
> based on the prospect that the next version of asp.net might change
> their rendering of id attributes?
>
> Insane man...
>
> "Brock Allen" <> wrote in message
> news: .com...
>
>> Sure, of course you can make it work. I think what I was trying to
>> say is that the pattern is what's documented to potentially change in
>> the future, thus the preference to use the ClientID property and
>> merge that dynamically into your javascript.
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> The id is known, one can set the id on the master page, content
>>> place holder controls, etc. The pattern is always the same. I know
>>> what the final rendered id value will be and can set the proper
>>> css/javascript selectors properly ahead of time.
>>>
>>> My problem is simply not having total control of the rendered id
>>> attributes and the verbosity of the rendered values.
>>>
>>> "Brock Allen" <> wrote in message
>>> news: .com...
>>>
>>>> The problem is that you don't know what some other control will
>>>> emit for an ID. I imagine what your problem is is that you want to
>>>> hard code the ID in your javascript to a well known value. Instead
>>>> of hard coding, the
>>>>
>>> approach
>>>
>>>> is to dynamically emit your javascript with the proper ID using the
>>>>
>>> Control.ClientID
>>>
>>>> property.
>>>>
>>>> -Brock
>>>> DevelopMentor
>>>> http://staff.develop.com/ballen
>>>>> Is there a way to prevent the INamingContainer behaviour that
>>>>> prefixes the id of server controls in master pages with the format
>>>>> [master page id]_[content id]_. I would prefer to manage the
>>>>> potential id attribute conflicts myself, rather than having such
>>>>> verbose id attributes throughout my site.
>>>>>
>>>>> Thanks,
>>>>> ~PJ



 
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 Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
INamingContainer Sam Samnah ASP .Net 1 08-04-2005 11:58 AM
INamingContainer Issue Sam Samnah ASP .Net 2 06-29-2005 03:24 PM
What does the INamingContainer Inteface do? gemel ASP .Net 3 01-06-2005 02:24 PM
INamingContainer and the LinkButton... Jo Inferis ASP .Net 1 05-27-2004 01:43 AM
INamingContainer no doing it's thing Joel Barsotti ASP .Net Web Controls 1 01-10-2004 07:41 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57