User Control generated names and javascript

J

Jim Corey

I'm experimenting with a code generator that creates
an html page which includes a lot of javascript that
modifies (for example) input boxes on the page.

I can paste the html into an aspx page, change some input boxes to asp
labels and the javascript can still work because the id's for the labels
still match the id's that
are referenced in the javascript.

I'd like to paste the html into an ascx control, but
here there will be a problem, since the id's are changed
when the page is rendered.

So... the question is
1. Is there a way to programmatically control the id's that are
generated? The clientID property is read-only,
so I would guess not.

2. A large amount of javascript has been generated. I could paste it
somewhere, modify it at run-time to change all the id's to match the
generated ones, then use RegisterClientScriptBlock. Where would be a
likely place to keep this? If there was a way to leave it in the ascx
html and then modify if at Page_Load, then I would have a working
scenario.

TIA,
Jim






*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top