Response object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

I have a problem with a page that allows my users to download an attachment
( word file or such like). When the page is loaded I have a table which shows
an action required flag if the user needs to create a letter. The user can
then click a create letter button and I generate a word document and send
this to the response object which gives the user the option to open or save (
standard ie window). The problem is I also update the database to remove the
action required flag so I now want to rebind my controls to make this flag
disappear in the interface but since the response has already been written
the postback stops and the page is not reloaded.

any ideas on how to get around this?
 
The only way I can think is that you open up a new window via javascript to
handle the download:

sub btn_click(...)
dim str as new StringBuilder()
str.Append("<script language='javascript'>")
str.Append(System.Environment.NewLine)
str.Append("window.open("generateLetter.aspx", "letter", "SOMEPARAM")
str.Append(System.Environment.NewLine)
str.Append("</script>")
Page.RegisterStartupScript("registerLetter", str.ToString())

UpdateDataBaseToRemoveFlag()
RebindControl()
End sub

letting registerLetter.aspx generate the word document...

Karl
 
Back
Top