Move between web pages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two pages set up in .net and I am trying to code behing a command
button in c# so that when the button is clicked, it will open another page.
Can you tell me how to do it. Any help is greatly appreciated as I am new to
programming. Thanks.
 
Hi Bill!

If you are using the 1.1 framework, then I would recommend using a standard
HTML button and a bit of client-side script to open a new window rather than
using the postback model of ASP .Net to do this.

<button onclick="window.open( 'http://yourpage' )">Click Me</button>

The model of ASP .Net 1.1 does not allow you to "post back" to another page.
ASP 2.0 allows you to specify the page to post back to.

Hope this helps!
 
If you are in ASP.NET 2.0 and using as ASP.NET button, you can set the
PostBackUrl property to the page you want to go to, as in the example below:

<asp:Button ID="btnFindACruise" runat="server" Text="Back to Find A Cruise"
PostBackUrl="~/FindACruise.aspx"/>

Mary D
 
Back
Top