Redirection Syntax

Results 1 to 3 of 3

Thread: Redirection Syntax

  1. #1
    BillyTheKid Guest

    Default Redirection Syntax

    I have two sexssion variables fro screen resolution:<BR><BR>request.QueryString("width")<BR >request.QueryString("height")<BR><BR>These have been collected using Javascript - what ASP code do I need to redirect users to two different pages as in <BR>IF SCREEN RES &#060;=800 THEN REDIRECT TO 800.asp<BR>IF SCREEN RES &#062;=800 THEN REDIRECT TO 1024.asp ?

  2. #2
    Join Date
    Dec 1969

    Default RE: Redirection Syntax

    You essentially just wrote the code...why didn&#039t you just try it?<BR><BR>If CInt(Request.QueryString("width")) &#060;= 800 Then <BR> &nbsp; Response.Redirect "800.asp"<BR>End If<BR>Response.Redirect "1024.asp"<BR><BR>(You don&#039t need an "else", because the redirect immediately takes you off the page, so there isn&#039t any other possibility but to "fall through".)<BR><BR>NOTE: I dunno how you are getting the screen width, but I hope you are making careful note of the differences in browsers. <BR><BR>

  3. #3
    BillyTheKid Guest

    Default RE: Redirection Syntax

    I tried this in both browsers and got this error message:<BR><BR>Response object error &#039ASP 0156 : 80004005&#039 <BR><BR>Header Error <BR><BR>/index.asp, line 34 <BR><BR>The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. <BR><BR>line 34 reads:<BR>Response.Redirect "1024.asp"%&#062; (ie the last line of your syntax)<BR><BR>What does this mean? <BR>

Posting Permissions

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