Hello, I have an issue I am having difficulty diagnosing..

In short, I have a asp page that generates only xml output for use
with an ajax application. On the last step of my process a simple xml-
word document is generated and displayed in a new window (or iframe).
The asp document is called with several querystring elements to
produce the document.

In IE7, when the document is returned from the server a Open/Save
dialog is presented. Here is where things get weird.. Occasionally the
filename will appear as expected, 'callproc.xml', however the majority
of the time the filename will appear as '...param1=00000&param2=abcd'.
This causes IE to fail opening or saving the document.

The XML being generated is valid and when saved will open with Word as
expected without error. I have also defined the content-type as text/
xml.

Questions:
1. How can I consistently get the returned xml document to appear
correctly without the querystring as part of the file name?
2. Is there anyway to avoid the Open/Save dialog when requesting an
XML document?

Any help on this will be greatly appreciated!

Re: ASP generating XML prompts save with query string by Anthony

Anthony
Fri Feb 22 12:53:44 CST 2008

<nbarwig@gmail.com> wrote in message
news:06341392-be1b-478d-92ea-2cbc73b8e7ef@q78g2000hsh.googlegroups.com...
> Hello, I have an issue I am having difficulty diagnosing..
>
> In short, I have a asp page that generates only xml output for use
> with an ajax application. On the last step of my process a simple xml-
> word document is generated and displayed in a new window (or iframe).
> The asp document is called with several querystring elements to
> produce the document.
>
> In IE7, when the document is returned from the server a Open/Save
> dialog is presented. Here is where things get weird.. Occasionally the
> filename will appear as expected, 'callproc.xml', however the majority
> of the time the filename will appear as '...param1=00000&param2=abcd'.
> This causes IE to fail opening or saving the document.
>
> The XML being generated is valid and when saved will open with Word as
> expected without error. I have also defined the content-type as text/
> xml.
>
> Questions:
> 1. How can I consistently get the returned xml document to appear
> correctly without the querystring as part of the file name?

Response.AddHeader "Content-Disposition", "filename=Whatever.xml"

> 2. Is there anyway to avoid the Open/Save dialog when requesting an
> XML document?

You might try a different content type with a view to getting MS Word to
accept and handle the stream. Try application/vnd.ms-word.main+xml


--
Anthony Jones - MVP ASP/ASP.NET




--
Anthony Jones - MVP ASP/ASP.NET



Re: ASP generating XML prompts save with query string by nbarwig

nbarwig
Fri Feb 22 13:40:57 CST 2008

On Feb 22, 10:53 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> <nbar...@gmail.com> wrote in message
>
> news:06341392-be1b-478d-92ea-2cbc73b8e7ef@q78g2000hsh.googlegroups.com...
>
>
>
> > Hello, I have an issue I am having difficulty diagnosing..
>
> > In short, I have a asp page that generates only xml output for use
> > with an ajax application. On the last step of my process a simple xml-
> > word document is generated and displayed in a new window (or iframe).
> > The asp document is called with several querystring elements to
> > produce the document.
>
> > In IE7, when the document is returned from the server a Open/Save
> > dialog is presented. Here is where things get weird.. Occasionally the
> > filename will appear as expected, 'callproc.xml', however the majority
> > of the time the filename will appear as '...param1=00000&param2=abcd'.
> > This causes IE to fail opening or saving the document.
>
> > The XML being generated is valid and when saved will open with Word as
> > expected without error. I have also defined the content-type as text/
> > xml.
>
> > Questions:
> > 1. How can I consistently get the returned xml document to appear
> > correctly without the querystring as part of the file name?
>
> Response.AddHeader "Content-Disposition", "filename=Whatever.xml"
>
> > 2. Is there anyway to avoid the Open/Save dialog when requesting an
> > XML document?
>
> You might try a different content type with a view to getting MS Word to
> accept and handle the stream. Try application/vnd.ms-word.main+xml
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
> --
> Anthony Jones - MVP ASP/ASP.NET

Thanks for the reply Anthony!

Here is the header I am producing.. I had thought of the content-
disposition, but it has made no difference.

Response.ContentType = "text/xml"
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
Response.AddHeader "Content-Disposition", "filename=callproc.xml"


Re: ASP generating XML prompts save with query string by Adrienne

Adrienne
Fri Feb 22 15:35:08 CST 2008

Gazing into my crystal ball I observed nbarwig@gmail.com writing in
news:c04b372e-30b6-4d89-82f3-8f27b269b8dd@u10g2000prn.googlegroups.com:

> On Feb 22, 10:53 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
>> <nbar...@gmail.com> wrote in message
>>
>> news:06341392-be1b-478d-92ea-
2cbc73b8e7ef@q78g2000hsh.googlegroups.com
>> ...
>>
>>
>>
>> > Hello, I have an issue I am having difficulty diagnosing..
>>
>> > In short, I have a asp page that generates only xml output for use
>> > with an ajax application. On the last step of my process a simple
>> > xml- word document is generated and displayed in a new window (or
>> > iframe). The asp document is called with several querystring
>> > elements to produce the document.
>>
>> > In IE7, when the document is returned from the server a Open/Save
>> > dialog is presented. Here is where things get weird.. Occasionally
>> > the filename will appear as expected, 'callproc.xml', however the
>> > majority of the time the filename will appear as
>> > '...param1=00000&param2=abcd'. This causes IE to fail opening or
>> > saving the document.
>>
>> > The XML being generated is valid and when saved will open with Word
>> > as expected without error. I have also defined the content-type as
>> > text/ xml.
>>
>> > Questions:
>> > 1. How can I consistently get the returned xml document to appear
>> > correctly without the querystring as part of the file name?
>>
>> Response.AddHeader "Content-Disposition", "filename=Whatever.xml"
>>
>> > 2. Is there anyway to avoid the Open/Save dialog when requesting an
>> > XML document?
>>
>> You might try a different content type with a view to getting MS Word
>> to accept and handle the stream. Try
>> application/vnd.ms-word.main+xml
>>
>> --
>> Anthony Jones - MVP ASP/ASP.NET
>>
>> --
>> Anthony Jones - MVP ASP/ASP.NET
>
> Thanks for the reply Anthony!
>
> Here is the header I am producing.. I had thought of the content-
> disposition, but it has made no difference.
>
> Response.ContentType = "text/xml"
> Response.Expires = 0
> Response.Expiresabsolute = Now() - 1
> Response.AddHeader "pragma","no-cache"
> Response.AddHeader "cache-control","private"
> Response.CacheControl = "no-cache"
> Response.AddHeader "Content-Disposition", "filename=callproc.xml"
>
>

What about content type?

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share


Re: ASP generating XML prompts save with query string by Anthony

Anthony
Sat Feb 23 16:26:13 CST 2008


<nbarwig@gmail.com> wrote in message
news:c04b372e-30b6-4d89-82f3-8f27b269b8dd@u10g2000prn.googlegroups.com...
> On Feb 22, 10:53 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> > <nbar...@gmail.com> wrote in message
> >
> >
news:06341392-be1b-478d-92ea-2cbc73b8e7ef@q78g2000hsh.googlegroups.com...
> >
> >
> >
> > > Hello, I have an issue I am having difficulty diagnosing..
> >
> > > In short, I have a asp page that generates only xml output for use
> > > with an ajax application. On the last step of my process a simple xml-
> > > word document is generated and displayed in a new window (or iframe).
> > > The asp document is called with several querystring elements to
> > > produce the document.
> >
> > > In IE7, when the document is returned from the server a Open/Save
> > > dialog is presented. Here is where things get weird.. Occasionally the
> > > filename will appear as expected, 'callproc.xml', however the majority
> > > of the time the filename will appear as '...param1=00000&param2=abcd'.
> > > This causes IE to fail opening or saving the document.
> >
> > > The XML being generated is valid and when saved will open with Word as
> > > expected without error. I have also defined the content-type as text/
> > > xml.
> >
> > > Questions:
> > > 1. How can I consistently get the returned xml document to appear
> > > correctly without the querystring as part of the file name?
> >
> > Response.AddHeader "Content-Disposition", "filename=Whatever.xml"
> >
> > > 2. Is there anyway to avoid the Open/Save dialog when requesting an
> > > XML document?
> >
> > You might try a different content type with a view to getting MS Word to
> > accept and handle the stream. Try application/vnd.ms-word.main+xml
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET
>
> Thanks for the reply Anthony!
>
> Here is the header I am producing.. I had thought of the content-
> disposition, but it has made no difference.
>
> Response.ContentType = "text/xml"

> Response.Expires = 0
> Response.Expiresabsolute = Now() - 1

Both of these set the Expires headers, use only 1 not both. Now() - 1 is
fairly good if you really want the content to expire.

> Response.AddHeader "pragma","no-cache"

Technically this can appear in a response but it is primarily used in
requests, I'd remove it.

> Response.AddHeader "cache-control","private"
> Response.CacheControl = "no-cache"

The CacheControl property sets the Cache-Control header so only use that
there is no need to attemtp to Add the cache control header yourself. Try:-

Response.CacheControl = "private; no-cache; max-age=0"

for a belts and braces header.

> Response.AddHeader "Content-Disposition", "filename=callproc.xml"
>

That looks good.

The only reason I can think of that would cause you to not always see this
filename is because the content is not being re-fetched from the server.
When IE re-uses content it already has it doesn't honor the
Content-Disposition header.


--
Anthony Jones - MVP ASP/ASP.NET



Re: ASP generating XML prompts save with query string by nbarwig

nbarwig
Mon Feb 25 12:15:09 CST 2008

On Feb 23, 2:26 pm, "Anthony Jones" <A...@yadayadayada.com> wrote:
> <nbar...@gmail.com> wrote in message
>
> news:c04b372e-30b6-4d89-82f3-8f27b269b8dd@u10g2000prn.googlegroups.com...> On Feb 22, 10:53 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> > > <nbar...@gmail.com> wrote in message
>
> news:06341392-be1b-478d-92ea-2cbc73b8e7ef@q78g2000hsh.googlegroups.com...
>
>
>
>
>
> > > > Hello, I have an issue I am having difficulty diagnosing..
>
> > > > In short, I have a asp page that generates only xml output for use
> > > > with an ajax application. On the last step of my process a simple xml-
> > > > word document is generated and displayed in a new window (or iframe).
> > > > The asp document is called with several querystring elements to
> > > > produce the document.
>
> > > > In IE7, when the document is returned from the server a Open/Save
> > > > dialog is presented. Here is where things get weird.. Occasionally the
> > > > filename will appear as expected, 'callproc.xml', however the majority
> > > > of the time the filename will appear as '...param1=00000&param2=abcd'.
> > > > This causes IE to fail opening or saving the document.
>
> > > > The XML being generated is valid and when saved will open with Word as
> > > > expected without error. I have also defined the content-type as text/
> > > > xml.
>
> > > > Questions:
> > > > 1. How can I consistently get the returned xml document to appear
> > > > correctly without the querystring as part of the file name?
>
> > > Response.AddHeader "Content-Disposition", "filename=Whatever.xml"
>
> > > > 2. Is there anyway to avoid the Open/Save dialog when requesting an
> > > > XML document?
>
> > > You might try a different content type with a view to getting MS Word to
> > > accept and handle the stream. Try application/vnd.ms-word.main+xml
>
> > > --
> > > Anthony Jones - MVP ASP/ASP.NET
>
> > > --
> > > Anthony Jones - MVP ASP/ASP.NET
>
> > Thanks for the reply Anthony!
>
> > Here is the header I am producing.. I had thought of the content-
> > disposition, but it has made no difference.
>
> > Response.ContentType = "text/xml"
> > Response.Expires = 0
> > Response.Expiresabsolute = Now() - 1
>
> Both of these set the Expires headers, use only 1 not both. Now() - 1 is
> fairly good if you really want the content to expire.
>
> > Response.AddHeader "pragma","no-cache"
>
> Technically this can appear in a response but it is primarily used in
> requests, I'd remove it.
>
> > Response.AddHeader "cache-control","private"
> > Response.CacheControl = "no-cache"
>
> The CacheControl property sets the Cache-Control header so only use that
> there is no need to attemtp to Add the cache control header yourself. Try:-
>
> Response.CacheControl = "private; no-cache; max-age=0"
>
> for a belts and braces header.
>
> > Response.AddHeader "Content-Disposition", "filename=callproc.xml"
>
> That looks good.
>
> The only reason I can think of that would cause you to not always see this
> filename is because the content is not being re-fetched from the server.
> When IE re-uses content it already has it doesn't honor the
> Content-Disposition header.
>
> --
> Anthony Jones - MVP ASP/ASP.NET

You rock Anthony. Thank you for you're responses. I took another
approach to generate the end document. Instead of writing a purely XML
word doc I just changed the header to be "word" and now write it out
in HTML which is much easier then pure XML :-D

Thanks alot, very helpful!