Fixing an Id for a HTML Tag

  • Thread starter Thread starter MS News
  • Start date Start date
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
 
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.
 
What about getting to that control at the Client Side via JavaScript
I have to generate dynamic javascript?

Thanks Steve
 
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
 
Back
Top