Response.redirect question.

Results 1 to 3 of 3

Thread: Response.redirect question.

  1. #1
    supernova Guest

    Default Response.redirect question.

    *<BR>I have a page approveuser.asp which updates the database. since my database is huge it takes a while therefore in between I have a screen delay.asp wanting to show the delay message.<BR><BR>My code is as following.<BR><BR>approveuser.asp<BR><BR>&#060;%Re sponse.buffer=true%&#062;<BR>&#060;%Message=URLSer ver.Encode("Loading, Please Wait...")<BR>Delaytime= 3<BR>Response.redirect("delay.asp?DelayTime=3&Dela yMessage="&Message&"&RedirectURL=approveuser.asp"% &#062;<BR><BR><BR>/code to update the database etc.....<BR><BR><BR>Now my delay.asp page has this<BR><BR>&#060;%Delay_Time = Request("DelayTime")<BR>Delay_Message= Request("DelayMessage")<BR>Redirect_URL = Request("RedirectURL")<BR>%&#062;<BR><BR>&#060;hea d&#062;<BR>&#060;meta http-equiv="Refresh" content = "&#060;%= DELAY_TIME%&#062;; URL=&#060;%= Redirect_URL"&#062;<BR>&#060;title&#062; Delay&#060;/title&#062;<BR>&#060;/head&#062;<BR> &#060;body&#062;<BR> &#060;font size = "5" color = "RED" &#062;&#060;strong&#062;&#060;%= DELAY_MESSAGE%&#062;/strong&#062;&#060;/font&#062;<BR><BR> &#060;/body&#062;<BR> &#060;/html&#062;<BR> <BR><BR> Here&#039s the problem.<BR>I have a link "update users". which is linked to the file approveuser.asp.<BR>I am expecting the delay.asp page to load until the user table is updated. But all I see is a blank screen (delay.asp)the parameters have not been passed.<BR>Is there anything wrong with the above code!<BR>Please Help!!!<BR>thank you very much

  2. #2
    Join Date
    Dec 1969
    Posts
    760

    Default RE: Response.redirect question.

    First: If you redirect before executing you DB code, you won&#039t execute your DB code.<BR><BR>I would suggest:<BR>send partial content to the browser ("Please wait...")<BR>When the database updates are done, send more content to the browser.<BR>The second piece of content can be a javascript that sends the user to the next page or a simple go here hyperlink<BR><BR>-Andrew<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    2,493

    Default RE: Response.redirect question.

    The problem is your delay page isn&#039t going to show until the code completes<BR>try doing this on the update page<BR>&#060;%<BR>Response.write "&#060;P&#062;&nbsp;&#060;P&#062;&#060;Center&#062 ;&#060;font size = "5" color = "RED" &#062;&#060;strong&#062;Loading, Please wait&#060;strong&#062;&#060;/font&#062;"<BR>your update code<BR>Then Response.redirect("anotherPage")<BR>%&#062;<BR><BR >I haven&#039t tested this but my thinking is that the Response.write portion will show then the update code will run then after its complete it will redirect to another page, I don&#039t think you want to use response.buffer=true because I think that will stop the page from loading in the browser until all code completes. <BR><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
  •