Results 1 to 10 of 10

Thread: response.redirect question

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    response.redirect question

    2 questions:
    what do I do if I want to redirect in, lets say 5 seconds? (I want to redirect when a button is pressed)

    umm also what does the second argument -endResponse- means: response.redirect (url as string, endResponse as boolean)

    VS.net tooltip says that it "indicates whether the excecution of the current page should terminate."

    but what kind of difference does that make? I dont understand. If you're redirecting to another page, doesnt that mean that the current page will be "terminated" anyways?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    no... endresponse will end the pages execution on that line (if set to true) otherwise execution will continue to the end of the page then redirect

    correct me if im wrong anyone

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by tailz
    no... endresponse will end the pages execution on that line (if set to true) otherwise execution will continue to the end of the page then redirect

    correct me if im wrong anyone
    oh man thanks! good thing I noticed that it's an overloaded function...
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    In regards to the first query, I would probably just call the setTimeout method in JavaScript. If anyone knows a better way using .Net I'd like to know as well

    Cheers
    MarkusJ

  5. #5
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    yea the redirection after a timeperiod, I'm 99% sure, would have to be done client side

  6. #6

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    umm ahem ahem, MrPolite doesnt really know any javascript

    anyone cares to "give him" the code that would redirect to a page in 5 seconds?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    something like this... (untested )

    Code:
    <HEAD>
      <SCRIPT>
        function forward() {
          //Redirect to new page
          self.location = "http://www.targetpage.co.uk/";   
        }
    
      </SCRIPT>
    </HEAD>
    
    <BODY>
      <SCRIPT>
        setTimeout("forward()",2000);     //Wait for 2000 milliseconds
      </SCRIPT>
    </BODY>

  8. #8

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hey thanks, btw this one worked, I havent tried yours:

    Response.Write("<META HTTP-EQUIV=""refresh"" CONTENT=""3;URL=some url"">")
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  9. #9
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    yea does same job, just yours is simpler

    All the time you'll see "you are being redirected to diff url, if browser doesnt redirect you click here..." etc

    does that mean some browsers dont support this? if so, anyone wanna list them?

  10. #10

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by tailz
    yea does same job, just yours is simpler

    All the time you'll see "you are being redirected to diff url, if browser doesnt redirect you click here..." etc

    does that mean some browsers dont support this? if so, anyone wanna list them?
    hmm probably... saying that, something wierd happened with this, I dont know what I did but no matter how many times I refreshed the page, it wouldnt redirect. I had to close the page and open a new page before it worked fine. I guess it could be because of asp.net stuff

    umm probably old borwsers dont support it... dunno maybe you'll get teh same thing if you've disabled scripting languages in your browser
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width