2

I am using C# ASP.net, and relative new to it, and need to accomplish below.

In my VS2010 web application project I have default.aspx, form1.aspx with button1 and form2.aspx.

1-I want to set form1 as my home page (the first page that opens when I run app) 2-Want to open form2 when I click button on form1

Also, can you please suggest good book that covers items like above?

thanks Jay

Ash Burlaczenko
  • 24,778
  • 15
  • 68
  • 99
user219628
  • 3,755
  • 8
  • 35
  • 37

3 Answers3

15

Quick start would be to double click the "button1" in designer view, which will generate a button1_click(...) event handler. In this routine, you could write one line of code:

Response.Redirect("~/form2.aspx");

To set Form1.aspx to your "homepage", it would make sense to rename it to "default.aspx" which is usally the page IIS looks for to start from.

Paul Grimshaw
  • 19,894
  • 6
  • 40
  • 59
2

hope it helps,

  1. When publishing, in the IIS you have to make the default page the form1.aspx page. In your VS2010 just right click on the file and set it as start page.

  2. Yes, the Response.Redirect answer posted is correct.

Vladimir
  • 408
  • 2
  • 7
1

I've found that ASP.NET Unleashed is really helpful for beginners. You can find it on amazon:

http://www.amazon.com/ASP-NET-4-Unleashed-Stephen-Walther/dp/0672331128

Code Maverick
  • 20,171
  • 12
  • 62
  • 114