Response.End on Downloading file?

Results 1 to 2 of 2

Thread: Response.End on Downloading file?

  1. #1
    Join Date
    Dec 1969

    Default Response.End on Downloading file?

    I have code on button click event which query the database and populate datareader and I loopthru it and write in to buffer.<BR>then I use it download that as following.<BR>But When I have response.end it stops there and<BR>my problem is I want to refresh the page after download done. here <BR>is the code<BR>While mdr.Read()<BR><BR> sb = New StringBuilder("")<BR> For i = 0 To mdr.FieldCount - 1<BR> If IsDBNULL(mdr(i)) Then<BR> sb.Append("""")<BR> sb.Append(mdr(i))<BR> sb.Append("""")<BR> sb.Append(vbTab)<BR> ElseIf ( _<BR> UCASE(mdr.GetDataTypeName(i)) = "VARCHAR" _<BR> Or UCASE(mdr.GetDataTypeName(i)) = "VARCHAR2" _<BR> Or UCASE(mdr.GetDataTypeName(i)) = "CHAR" _<BR> ) And re.IsMatch(mdr(i)) Then<BR> &#039;ElseIf re.IsMatch(mdr(i)) Then<BR> sb.Append("=""")<BR> sb.Append(mdr(i))<BR> sb.Append("""")<BR> sb.Append(vbTab)<BR> Else<BR> sb.Append("""")<BR> sb.Append(mdr(i))<BR> sb.Append("""")<BR> sb.Append(vbTab)<BR> End If<BR> Next<BR> sb.Append(vbCrLf)<BR> Response.Write(sb.ToString())<BR> sb = Nothing<BR><BR> End While<BR><BR> Response.End<BR><BR>i dont know how i can refresh page once its been on download window.

  2. #2
    Join Date
    Dec 1969

    Default hmm..

    Could you open up a new window to do the download? Otherwise, you will probably need to set up some hidden field on the page which you set when download occurs. Then in the client script for the page, you just resubmit the page if the hidden value exists.

Posting Permissions

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