Control name??

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
 
M

MCP Daniel Sharp

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

regards
daniel #
MCP Dev Web App C#
 
T

TaeHo Yoo

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
 

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
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top