Is this a ParseControl bug?

C

Chris Simeone

When I use ParseControl in a C# code behind to create a button...

Control c3 = ParseControl("<asp:button id='Button3' text='Btn3'
oncommand='OnButton' commandname='Btn' commandargument='b3'
runat='server' />");

The HTML that's rendered looks like this...

<input type="submit" name="Button3" value="Btn3" id="Button3"
oncommand="OnButton" />


I don't believe the "oncommand..." parameter should be rendered. Is
this a bug in ParseControl?

Thanks,
Chris
 
B

bruce barker

asp.net control parser alway emits attibutes it knows nothing about, as its
legal in html to assign them.

-- bruce (sqlwork.com)
 
P

Patrice Scribe

This is likely to ease client side processing. Unrecognized attributes are
made automatically available as a property :

<input MyPropertty="This Message" onClick="alert(this.MyProperty);"> should
show the message stored in the non standard attribute...

Patrice
 

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,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top