Client-Side Button

  • Thread starter Thread starter Guadala Harry
  • Start date Start date
G

Guadala Harry

All of my ASP.NET programming to date involving buttons required server-side
processing. But now I need for a button to simply open another window and I
don't want to use a server control for this simple task. This is what I came
up with. Is this a standard way to accomplish the objective? Is there a
better way?

<input type="button" id="btnTest" value="Click Me"
onClick="window.open('OtherPage.aspx', '_parent')" class="buttonStyle">

Thanks!
 
Guadala,
Yes, that is a very good way to do it!! That functionality doesn't need
ASP.NET at all. This is simply html and javascript running on the client.
When server-side functionality is not required, you are wise to use
client-side functionality like this.

Best regards,
Jeffrey Palermo
 
Back
Top