ParseControl()

J

Jeremy McPeak

Good morning. I am having a problem with the TemplateControl.ParseControl()
method. It does parse the string into a control; however, added attributes
are left out of the parsing and make it to the final HTML code. For
example:

ParseControl("<asp:button OnClick="Btn_Click" text='Click here!'
runat='server' />");

Becomes this HTML:

<input type="submit" OnClick="Btn_Click" />

I can somewhat see why this would happen, as onclick is an event of the
browser. However, I need ParseControl() to treat OnClick as the ASP.NET
event, not the browser's DOM. Any suggestions?
 

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,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top