Fixing an Id for a HTML Tag

M

MS News

Hi all

is there a way to fix an id

like id=txtCheckedItems

aspx changes it to _ctl0_eee_txtCheckedItems

in
<input name="_ctl0:eee:txtCheckedItems" id="_ctl0_eee_txtCheckedItems"
type="hidden" size="28" />

How else can this be done


Thank for your help

Jim
 
S

Steve C. Orr, MCSD

ASP.NET renames them to prevent naming conflicts and to keep the naming
consistent.
You can get the true ID at run time from the ClientID property of the
control.
You also should be able to inherit a control and override this property for
more manual control of the naming.
 
M

MS News

What about getting to that control at the Client Side via JavaScript
I have to generate dynamic javascript?

Thanks Steve
 
V

Vincent V

You can created a Public Variable in ur code with the client id
Ie
Public MyString as string
Page load / maybe INIT
MyString = mycontrol.id / clinetid
in ur htmlcode where u need client id in javascript <% =MyString %>
somthing like that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top