470,866 Members | 1,945 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,866 developers. It's quick & easy.

Move between web pages

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.
Feb 24 '06 #1
2 1940
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!

"BIll Mills" wrote:
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.

Feb 24 '06 #2
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

"Tyler Durham (Microsoft Services)" wrote:
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!

"BIll Mills" wrote:
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.

Apr 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by cfmx | last post: by
1 post views Thread by Harald Weiser | last post: by
4 posts views Thread by Vincent Yang | last post: by
4 posts views Thread by David Hearn | last post: by
3 posts views Thread by Wayne Wengert | last post: by
10 posts views Thread by Robert | last post: by
8 posts views Thread by Gianni Rondinini | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.