for people who dont know about response.flush

Results 1 to 2 of 2

Thread: for people who dont know about response.flush

  1. #1
    Join Date
    Dec 1969

    Default for people who dont know about response.flush

    hi,<BR>this is just an information of how response.flush helped me when i was actually struck with a page which response.redirected to another page without displaying an error.<BR><BR>I hope many people would have come across doing functionalities like below.<BR><BR>i have a form which has a photo input to be uploaded. When the form is submitted, i wanted to check whether the image already exists or not and wrote a javascript confirm box to ask user whether he wants to ovewrite the image or not if the image exists. After all this i insert a record in the DB and use a response.redirect to display a failure or success depending on the db insert.<BR><BR>But my problem was that when the image existed, the page will still insert a record in the DB and ger re-directed instead of displaying the javascript confirm box and i did not know how to proceed. Everything was correct in my code except for a response.flush, which i did not include after the error message because of which the asp proceses all asp code and thus redirects the page without processing the clientside javascript!!!<BR><BR>have anyone approached this in a different way?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: for people who dont know about response.flush

    Well I&#039;m using SQL and I use (in a stored proc)<BR><BR>if exists(select myfield from mytable where myfield=userinput)<BR> begin<BR> select &#039;recordexists&#039;<BR> return<BR> end<BR><BR>...continue with processing<BR><BR>In ASP page you check rs(0) to see if it equals &#039;recordexists&#039;.<BR><BR>If i&#039;m not using stored procedures then I usually have have a field in my db called "record_temp". This record is set to true until the very last moment, then it gets set to false.<BR><BR>Likewise every time the first page of the form is called, it deletes all the temporary records:<BR><BR>DELETE FROM mytable WHERE table_temp=true

Posting Permissions

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