Control name??

  • Thread starter Thread starter TaeHo Yoo
  • Start date Start date
T

TaeHo Yoo

In a web user control, control id changes.
For instance, I created a textbox whose id is txtname and if you run it
and view source, you will notice its id has changed to something like
"_c1__c3_txtname".
So when you access the control using javascript, you have to say
document.getelementbyid("_c1__c3_txtname").value

Ok now my problem is sometimes this control's id gets changed somehow
(from "_c1__c3_txtname" to "_c1__c4_txtname") that results in javascript
doesn't work.

Are there any ways of tackling this problems?

Thanks
 
i recommend to use scripting dinamyc
with property clientId for the textbox

regards
daniel #
MCP Dev Web App C#
 
Thanks daniel,

But could you explain a bit more?
Say the original property clientId of a textbox is "txtname" but when
you run the program and view source code, it has changed to
"_c2__c3_txtname" so that if you try to access this control via
javascript by saying document.getElementById("txtname").value, it will
cause an error.
Could you tell me how you would get the value of the client control in
client site?

Thanks
 
Back
Top