470,594 Members | 1,231 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

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?

Feb 16 '07 #1
1 12114

"Andyza" <an****@webmail.co.zawrote in message
news:11**********************@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;")

Feb 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Adam B | last post: by
1 post views Thread by abcd | last post: by
3 posts views Thread by Lars Netzel | last post: by
8 posts views Thread by Tony | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.