Re: Problem with postback after Response.Write

From: Patrice (nobody_at_nowhere.com)
Date: 10/07/04


Date: Thu, 7 Oct 2004 19:59:52 +0200

Ok, I believe the correct terminology is :
- the browser makes a request to the server (GET to get the page)
- the user enter values and click the submit button
- the browser POST those data to the original page (post back)
- the server could then resend the page or somewhere else

It's always better to have the whole picture. What is this ActiveX control ?
>From where can it get its data ?

If this is under control I would do something like :
- the file content could be passed to the activeX control as a PARAM tag

If there is a size limit for this tag, it could be likely stored inside the
document. You can then tell the ActiveX control the id of the page element
that holds the data (likely not familiar with controls hosted in a page but
I assume they can access the surrounding HTML page). Or thorugh it's
progamming model, you could have some JavaScript that transfer the data.

You could also have perhaps the ActiveXControl contacting the server to get
the data.

Also could you deliver this file as a single PDF file and let the user print
it ??

Patrice

-- 
"Russ" <russk2@eticomm.net> a écrit dans le message de
news:2fsam01s2iv24i56lnmgebsn4g7o8e4e16@4ax.com...
> On Thu, 7 Oct 2004 11:38:54 +0200, "Patrice" <nobody@nowhere.com>
> wrote:
>
> >What do you mean by "posting back" ?
>
> Well, I believe I have the terminology right, but maybe not.  Im my
> mind, postback is when a runat=server control is used.  The browser
> connects to the server - the server executes some code and generates a
> new copy of the web page (or possibly transfers control to a different
> page), and sends the changed page back to the browser which displays
> it.  So the posting back is two steps - the browser posts back to the
> server and then the server posts back to the browser.  In my case, the
> problem seems to be that there seems to be no way to post back to the
> server after the download dialog has completed.
>
> >My understanding is that you want to stream a file in response to a
request.
> >As you send a file, you have to send only the file content, no more, no
> >less. Though you can still perform some code after sending the file,
> >response.redirect would write an additonnal header to the response. The
> >supplemental header suggested by someone else could work as it is to be
> >written before.
>
> It didn't work.  The problem is that I am not really downloading a
> file.  The data being written to the file is assembled 'on the fly' by
> the server and sent to the browser via the Response.Write calls.  The
> browser allows the user to save the data as a file and then an ActiveX
> control  is supposed to be run.  (The Activex control parses the file
> and sends the various sections of it to the printer as separate
> reports.)  This should be as transparent to the user as possible.  It
> is asking a lot of the user to have to click the button that says
> "print these reports", then go though the download dialog to save a
> file, and then click another button to say "now REALLY print them".
>
> My alternative is to make the button that says "print these reports"
> instead say "download these reports".  Then supply a separate button
> to say "print the downloaded reports".  That would not be so bad, but
> I would want the 'print' button to be disabled until after the
> download is complete.  (Otherwise the user could click the print
> button before the file was downloaded, and might print some reports
> from the last time instead of what he wanted.)  Since I cannot get
> control after the download is complete, there is also no way to enable
> the print button - unless you or someone comes up with a magic bullet
> that will do this.
>
> >...Note that performing some code server side is not the problme. The
problem
> >is that you want to display something to the user once the download is
> >completed...
>
> That's exactly right.  This is a Web Business application and the same
> rules that apply for casual web browsing do not work too well.
> Microsoft has been touting ASP.NET applications for business use, but
> it seems like a lot of needed functionality is either missing or hard
> to find.  I've been thinking about trying the new version but someone
> said it would not be ready for production use for another year and I
> cannot wait that long.  Hopefully there exists work-arounds for some
> of the issues I am facing.
>
> Thanks for all your help.
>
> Regards, Russ
>
> >
> >Patrice
>