Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Why save as dialog is displaying twise

Reply
Thread Tools

Why save as dialog is displaying twise

 
 
Vijay Neelam
Guest
Posts: n/a
 
      10-30-2003
Hi all,
Dim a As String = Response.ContentType
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.AddHeader("content-disposition", "attachment;
filename=Document.doc")
Response.Write(strDoc)
Response.ContentType = a
Response.End()

I'm writing this code in ASP.NET I'm getting download dialog box but I'm
getting twise if I clicked on open.

My purpose is I want to download a worddocument from server and also need to
write some string in that document.

Open is only opening MSWord window but not opening document.

Does any one know solution to this problem.. please post

Thank you,
Vijay Neelam


 
Reply With Quote
 
 
 
 
HD
Guest
Posts: n/a
 
      10-30-2003
Dont think things have changed with ASP.NET to that an extent.
What you are trying to do Vijay would only tell the client browser that the
server is pushing data of type word in the response. hence it asks you
whether you would like to save it.
If you want ASP.net to word and write something to the file then you will
have to look into server side code. Create an object of type
word.application and then write to it. Save it n the harddrive and transfer
the script to the relative location of word doc. or save it and then use
binary reading and write the binary info to response post the headers you
were using.

hope i help clear things out,

HD

"Vijay Neelam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
> Dim a As String = Response.ContentType
> Response.Clear()
> Response.Buffer = True
> Response.ContentType = "application/msword"
> Response.AddHeader("content-disposition", "attachment;
> filename=Document.doc")
> Response.Write(strDoc)
> Response.ContentType = a
> Response.End()
>
> I'm writing this code in ASP.NET I'm getting download dialog box but I'm
> getting twise if I clicked on open.
>
> My purpose is I want to download a worddocument from server and also need

to
> write some string in that document.
>
> Open is only opening MSWord window but not opening document.
>
> Does any one know solution to this problem.. please post
>
> Thank you,
> Vijay Neelam
>
>



 
Reply With Quote
 
 
 
 
Jose Gonzalez
Guest
Posts: n/a
 
      10-30-2003
What browser are you using?
this sounds similar to a problem I was having before.
I might be wrong but I think it was an issue in IE 5.x.

>-----Original Message-----
>Hi all,
>Dim a As String = Response.ContentType
>Response.Clear()
>Response.Buffer = True
>Response.ContentType = "application/msword"
>Response.AddHeader("content-disposition", "attachment;
>filename=Document.doc")
>Response.Write(strDoc)
>Response.ContentType = a
>Response.End()
>
>I'm writing this code in ASP.NET I'm getting download

dialog box but I'm
>getting twise if I clicked on open.
>
>My purpose is I want to download a worddocument from

server and also need to
>write some string in that document.
>
>Open is only opening MSWord window but not opening

document.
>
>Does any one know solution to this problem.. please post
>
>Thank you,
>Vijay Neelam
>
>
>.
>

 
Reply With Quote
 
HD
Guest
Posts: n/a
 
      10-30-2003
Jose,

The reason its asked atleast once is that .doc is not associated with the
browsers unless you have a plugin when then i think it will ask you once.
The above example would work fine with txt file cause txt files not have any
custom headers and txt files are fine with txt files are client response.
With .doc you have a custom header and he needs to write the .doc file
header in order to populate it.

HD

The problem is because the header is possibly not perfect.
Dont know everything about ASP.NET but
"Jose Gonzalez" <(E-Mail Removed)> wrote in message
news:019d01c39f08$5e499060$(E-Mail Removed)...
> What browser are you using?
> this sounds similar to a problem I was having before.
> I might be wrong but I think it was an issue in IE 5.x.
>
> >-----Original Message-----
> >Hi all,
> >Dim a As String = Response.ContentType
> >Response.Clear()
> >Response.Buffer = True
> >Response.ContentType = "application/msword"
> >Response.AddHeader("content-disposition", "attachment;
> >filename=Document.doc")
> >Response.Write(strDoc)
> >Response.ContentType = a
> >Response.End()
> >
> >I'm writing this code in ASP.NET I'm getting download

> dialog box but I'm
> >getting twise if I clicked on open.
> >
> >My purpose is I want to download a worddocument from

> server and also need to
> >write some string in that document.
> >
> >Open is only opening MSWord window but not opening

> document.
> >
> >Does any one know solution to this problem.. please post
> >
> >Thank you,
> >Vijay Neelam
> >
> >
> >.
> >



 
Reply With Quote
 
Vijay Neelam
Guest
Posts: n/a
 
      10-31-2003
I followed all suggestion given in link you have mentioned.Even I cleared
Headers , But still I'm getting open dialog twise...

I'm using IE 6.02800.1106

Update Versions:; SP1; Q810847; Q813951; Q813489; Q330994; Q818529; Q822925;
Q828750;

Even I checked all possible combinations in response.header like Filename
and filename
\".

Response.Buffer = True
Response.Clear()
Response.Charset = "UTF-8"
Response.ContentType = "application/msword"
'Response.ContentType = "application/octet-stream"
Response.ClearHeaders()
Rsponse.AddHeader("content-disposition", "attachment;
filename=document.doc")
Response.Write("String")
Response.Flush()
Response.End()
Thank you
Regards
vijay neelam
"HD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Jose,
>
> The reason its asked atleast once is that .doc is not associated with the
> browsers unless you have a plugin when then i think it will ask you once.
> The above example would work fine with txt file cause txt files not have

any
> custom headers and txt files are fine with txt files are client response.
> With .doc you have a custom header and he needs to write the .doc file
> header in order to populate it.
>
> HD
>
> The problem is because the header is possibly not perfect.
> Dont know everything about ASP.NET but
> "Jose Gonzalez" <(E-Mail Removed)> wrote in message
> news:019d01c39f08$5e499060$(E-Mail Removed)...
> > What browser are you using?
> > this sounds similar to a problem I was having before.
> > I might be wrong but I think it was an issue in IE 5.x.
> >
> > >-----Original Message-----
> > >Hi all,
> > >Dim a As String = Response.ContentType
> > >Response.Clear()
> > >Response.Buffer = True
> > >Response.ContentType = "application/msword"
> > >Response.AddHeader("content-disposition", "attachment;
> > >filename=Document.doc")
> > >Response.Write(strDoc)
> > >Response.ContentType = a
> > >Response.End()
> > >
> > >I'm writing this code in ASP.NET I'm getting download

> > dialog box but I'm
> > >getting twise if I clicked on open.
> > >
> > >My purpose is I want to download a worddocument from

> > server and also need to
> > >write some string in that document.
> > >
> > >Open is only opening MSWord window but not opening

> > document.
> > >
> > >Does any one know solution to this problem.. please post
> > >
> > >Thank you,
> > >Vijay Neelam
> > >
> > >
> > >.
> > >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Closing the Open Save Dialog when user selects Save BusyBoy ASP .Net 2 10-31-2006 03:46 PM
calling a css file twise from the same page neoswf HTML 4 01-30-2006 11:43 AM
Why save dialog displaying twise Vijay Neelam ASP .Net 1 10-30-2003 01:28 PM
Why save dialog displaying twise Vijay Neelam ASP .Net Security 0 10-30-2003 07:38 AM



Advertisments