Click here to Skip to main content
15,921,250 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hii Dears

could any one please tell me how to hide an aspx page in its load event.
I have 3 aspx pages. On the first page there is a button.On this button click we will redirect
to second aspx page. On the load event of second page we will redirect to third aspx page automatically.
User just want to see the first and third pages only.But presently the user can see all the 3 pages. I can not avoid the second page because it contains some complex calculations.The second page will work if and only if it gets some data from the first page and the third page will work only if it gets data from the second page.
I have tried " this.visible=false; Response.Redirect("defaul2.aspx"); " in the page load event of second page.but still it shows the second page. If anyone has idea about this kindly help me..


Thank You all......
Posted
Updated 6-May-14 19:51pm
v2

You could have found the answer to this yourself in about 15 seconds. All you have to do is Google for "asp.net redirect page[^]".
 
Share this answer
 
In your Page_Load method of second page write

Response.Redirect("defaul2.aspx");
 
Share this answer
 
Thank you for your reply

I have written

this.visible=false;
Response.Redirect("defaul2.aspx");

in the load event of second page.It functions properly but it shows the second page.
Actually the user doesn't want to see the second page. could you please tell me how to hide the second page from the user...

thank you
 
Share this answer
 
Hi Subha,

In Page2.aspx.cs write the following.

C#
protected void Page_Init()
       {
           Response.Redirect("Page3.aspx");
       }
 
Share this answer
 
C#
protected void Page_PreLoad(object sender, EventArgs e)
    {
     Response.Redirect("Page3.aspx");
    }
 
Share this answer
 
write Response.Redirect("~/page3.aspx"); in page load event of second page.

or write Response.Redirect("~/page3.aspx"); in button click event of page 1.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900