Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Response.AddHeader problem when using Javascript as the server-side scripting language (http://www.velocityreviews.com/forums/t802772-response-addheader-problem-when-using-javascript-as-the-server-side-scripting-language.html)

Andyza 02-16-2007 12:43 PM

Response.AddHeader problem when using Javascript as the server-side scripting language
 
With reference to the ASPFAQ 2161 article -
http://classicasp.aspfaq.com/general...mime-type.html

Does the 'Content-Disposition' code work if the user is using
JAVASCRIPT as the SERVER SIDE scripting language, i.e.:

<%@LANGUAGE=JAVASCRIPT%>

If I add this header to a page that uses Javascript as the server-side
scripting language:

Response.ContentType = "application/save"
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

Then the page crashes with:

Microsoft JScript compilation (0x800A03EC)
Expected ';'
/myform.asp, line 8, column 19
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

Line 8, column 19 is:
Response.AddHeader "Content-Disposition: attachment;
filename=MySpreadsheet.xls;"

It looks like IIS doesn't like something in the "Content-Disposition:
attachment; filename=MySpreadsheet.xls;" part of line 8 - probably a
Javascript syntax thing.

How can I fix it?


Anthony Jones 02-16-2007 01:18 PM

Re: Response.AddHeader problem when using Javascript as the server-side scripting language
 

"Andyza" <andyza@webmail.co.za> wrote in message
news:1171629801.509927.205750@t69g2000cwt.googlegr oups.com...
> With reference to the ASPFAQ 2161 article -
>

http://classicasp.aspfaq.com/general...mime-type.html
>
> Does the 'Content-Disposition' code work if the user is using
> JAVASCRIPT as the SERVER SIDE scripting language, i.e.:
>
> <%@LANGUAGE=JAVASCRIPT%>
>
> If I add this header to a page that uses Javascript as the server-side
> scripting language:
>
> Response.ContentType = "application/save"
> Response.AddHeader "Content-Disposition: attachment;
> filename=MySpreadsheet.xls;"
>
> Then the page crashes with:
>
> Microsoft JScript compilation (0x800A03EC)
> Expected ';'
> /myform.asp, line 8, column 19
> Response.AddHeader "Content-Disposition: attachment;
> filename=MySpreadsheet.xls;"
>
> Line 8, column 19 is:
> Response.AddHeader "Content-Disposition: attachment;
> filename=MySpreadsheet.xls;"
>
> It looks like IIS doesn't like something in the "Content-Disposition:
> attachment; filename=MySpreadsheet.xls;" part of line 8 - probably a
> Javascript syntax thing.
>
> How can I fix it?
>


All procedures are functions in JScript all calls must use ( )

Try:-

Response.AddHeader("Content-Disposition: attachment;
filename=MySpreadsheet.xls;")





All times are GMT. The time now is 02:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57