Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 05-06-2009
Member
 
Join Date: May 2008
Posts: 351
C#.NET redirect after 5 seconds

I am created a web based project in C#.NET. On the HOME page, there is a link which calls another webpage using Response.Redirect () function. But there I got the problem. Every time I click on the link the browser waits for 5 seconds and then redirects me to the next page. Does anyone know what and why is happening this?
Reply With Quote
  #2  
Old 05-06-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: C#.NET redirect after 5 seconds

Redirect code on your calling page:

Quote:
Response.Redirect("YourPage.aspx");
In the load event of called page that you are redirected to, use the HtmlMeta object to redirect immediately:

Code:
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "Refresh";
meta.Content = "0; URL=Alert.aspx";
Page.Header.Controls.Add(meta);
where the number 0 (immediately) is the number of seconds to wait before redirecting.
Reply With Quote
  #3  
Old 05-06-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: C#.NET redirect after 5 seconds

Why don't you use onclick function of javascript rather than using server control button. For the link you can mention something like window.location.href = "website_name"
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "C#.NET redirect after 5 seconds"
Thread Thread Starter Forum Replies Last Post
Computer Freezes for a few seconds about every 20 seconds marcusjb Motherboard Processor & RAM 4 11-12-2011 11:15 PM
How to redirect a page in JSP Level8 Software Development 5 26-02-2010 10:23 PM
How to redirect iframe in PHP Ground 0 Software Development 3 08-08-2009 01:01 PM
Redirect dns or iis? The_cobra666 Windows Server Help 4 05-12-2007 06:47 PM


All times are GMT +5.5. The time now is 03:08 PM.