derived custom controls from Button or ImageButton

J

jiatiejun

I want write a custom controls (Button or ImageButton derived)

and want set the "name" tag to my custom value

use this.Attributes["name"] = "MyNameValue";

or writer.AddAttribute(HtmlTextWriterAttribute.Name, "MyNameValue");

asp.net add my "name" tag

but itself name tag still exists

result HTML code:

<input type="submit" name="MyButton1" value="" id="MyButton1"
name="MyNameValue" />
---------------------------^^^^^^^^^ Button base class
+^^^^^^^^^^^ I add name tag
-------------------------------------------------------------------+

how to remove Button base class name tag ?


thanks
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top