Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ASP.NET to write a standard non-submit HTML button

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
Hi,

I have some ASP.NET code that programatically writes a button onto the page, but I don't want this to be a submit button. I just want the button to fire a Javascript event. In other words I want to end up with the following HTML...

Code:
<input type="button" name="whatever" value="" />

I would have thought Button server controls would have had an AutoPostBack property, but they don't (I'm using ASP.NET 1.0 here). Any ideas? I can't just write out the HTML above because I need this to be a server control.

Your help is appreciated!

Tom
emo_big_smile.gif
 
Tom,

I'm not sure how to help with the posted issue but you must be trying this in order to add certain functionality or solve a problem.

Perhaps a different solution other than the one you posted would work equally as well.

What are you trying to do? What does the javascript do?

LL
 
It's OK, I've discovered the HtmlInputButton control which is exactly what I was looking for. It renders an HTML input button with type set to 'button'. Problem solved.

Tom
emo_big_smile.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top