Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
protected void btn_Login(object sender, EventArgs e)
   {


       if (Page.IsValid)
       {
           string ID = TextBox1.Text;
           string username = TextBox2.Text;
           string password = TextBox3.Text;
           AuthenticateUserLoginDetails(ID, username, password);

           if (this.isUserAuthentic)
           {
               // Redirect to the loading page
               Session["ProcessRedirect"] = String.Empty;
               Response.Redirect(ResolveUrl("~/Processing.aspx?sid=" + Session.SessionID.ToString() + "&st=3"), false);

            


           RedirecttoDestination();

               
           }
       }

   }


In one 1.aspx page i have created a button when i try to click that button then it redirect to 2.aspx page in this mean time when it is redirecting to a page an image load is going to display im able to display that Processing.aspx page which contains the Image load and some content in it before the page get displayed but im not able to fade that page it just go in running

here in this method we can find
Session[...]=string.empty;
Response.redirect(ResolveUrl('.....'));

helps for displaying the Image load

but the imageload gets go on displaying but it is not redirecting to desitnation page i like to know how to end this imageloading and go for RedirecttoDestination() so that it redirects to the specified page.

thank you
Posted
Updated 10-Oct-13 2:16am
v2
Comments
Thanks7872 10-Oct-13 8:06am    
Not clear what the issue is.Only i understand is you are displaying some thing like Please wait.... message and used a seperate page for that,right?
Tom Marvolo Riddle 10-Oct-13 8:14am    
@Rohan Leuva:He wants to redirect from one page to another page after button click.In the mean time of loading the page he wants to display a "Loading"image.The problem is Image is shown but the page not get redirected.Am i right Sumanth?
sumanth n 10-Oct-13 8:18am    
Yes Jas24
exactly, thats what want
sumanth n 10-Oct-13 8:11am    
yes for displaying that i used another page
Thanks7872 10-Oct-13 8:17am    
Let me clear you,to display this message,you should not use seperate page :bad idea:. Use JQuery instead

My first question to you, why do you need to use an intermediate page to show "Please wait..." or any other message? Even if you show this intermediate page and redirect to the destination page, again the browser will not load the destination page instantly. It will load the contents and take the time according to the page size and network speed.

My second question, why do you need to pass session id as query string. Again, there is no need. You can access it from code behind and use it there without exposing it to the users.

You need to show the loading image/message on the destination page itself.

The messages or images you want to show to the user are called preloaders and there are plenty of them available online. I would suggest to go with a JQuery preloader. This[^] one looks very nice. Have a look at it and revert if it serves the purpose.
 
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