dynamic controls

  • Thread starter Thread starter Kevin Mat
  • Start date Start date
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
 
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
 
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

Back
Top