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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET button navigation

Status
Not open for further replies.

crabgrass

Technical User
Aug 29, 2007
111
US
Here's a fairly simple but not obvious (at least to me) question.
Given a regular ASP button:
Code:
<input type="button" name="cmdSites" value="Businesses" onclick="javascript: document.forms[0].action='sites1.asp'; document.forms[0].submit();">

How would you define the equivalent onclick in the new .NET environment?

Thanks
 
If you want to use a button server-side, just use a server-side button rather than a HTML one .e.g
Code:
<asp:Button id="myButton" runat="server" />
You can then handle the click event of the button in your code-behind page.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Sorry I wasn't clear. Yes I'm trying to set up a server side button, but what code would you place in the click event to accomplish the page redirect?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top