Response.redirect and ContentType?

Results 1 to 3 of 3

Thread: Response.redirect and ContentType?

  1. #1
    Dan C Guest

    Default Response.redirect and ContentType?

    i have a comma delimited file saved as a text file. How can i get the browser to open that file up in excel?<BR><BR>Right now i just do a <BR>response.redirect "mydelimitedfile.txt"<BR><BR>and it will show up fine in the browser. How can i get That text file to be interpreted by excel.<BR><BR>My page has a form with a button("mybutton"). when that submit button is pushed i want the action to take place. So far i had<BR><BR>if request.form("mybuton")&#060;&#062;"" then<BR> response.redirect "mydelimitedfile.txt"<BR>end if

  2. #2
    Join Date
    Dec 1969

    Default RE: Response.redirect and ContentType?

    This is what I use. hiddenSTRHTML needs to be in HTML format (tables)<BR><BR>&#060;%<BR> Response.ContentType = "application/"<BR> <BR> strHTML = Request("hiddenSTRHTML")<BR>%&#062;<BR><BR>&#060;h tml&#062;<BR> &#060;%Response.Write strHTML %&#062; <BR>&#060;/html&#062;<BR>

  3. #3
    me again... Guest

    Default RE: Response.redirect and ContentType?

    Forgot to say: use something similar to this as your onclick event for the button. The code I gave before can be saved as download.asp. In our function, we set the value of a hidden field called hiddenSTRHTML equal to the HTML table we wanted to show in Excel. Maybe you can alter this code to fit your needs.<BR><BR>Function func_EXCEL<BR> MainForm.Target = "_Blank"<BR> MainForm.Action = "download.asp"<BR> MainForm.Submit<BR>End Function

Posting Permissions

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