dynamic controls

K

Kevin Mat

hi,

In my aspx page I do have some dynamic aspx controls. I am using
document.getElementById('pageID_Ctl1_text1') in the javascript to copy some
values from these controls. It is working in the first time, and these
controls id values are changing after the page reloaded. I am getting the
error on this getElementById.

This was working in 2003 and after migrating to 2005, it is not working.

Any help would be appreciated.

Thanks
Kevin
 
K

Kevin Mapppov

thanks for the reply,
the controls are in a user control and it is placed in an aspx page. the
controls in the user controls are dynamic.
it will create new id after the page got reloaded.
Eg: pageid_ctl1_text1 will change to pageid_ctl2_text1
 
G

Guest

thanks for the reply,
the controls are in a user control and it is placed in an aspx page. the
controls in the user controls are dynamic.
it will create new id after the page got reloaded.
Eg: pageid_ctl1_text1 will change to pageid_ctl2_text1

"Ladislav Mrnka" <[email protected]> wrote in message


use a mix of ASP.NET and javascript

document.getElementById("<%=text1.ClientID%>");

where text1 is id of your Control, e.g.

<asp:TextBox id="text1" runat="server"/>
 

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

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top