Results 1 to 3 of 3

Thread: C#.NET redirect after 5 seconds

  1. #1
    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?

  2. #2
    Join Date
    Nov 2005
    Posts
    1,323

    Re: C#.NET redirect after 5 seconds

    Redirect code on your calling page:

    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    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"

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,555,863.60841 seconds with 16 queries