You can do it the other way, this may help. For example, in your JavaScript
block:
newwindow=window.open("<%=sPopupedWindow%>");
</SCRIPT>
and in the codebehind:
Protected sPopupedWindow As String = ""
You can adapt this to your situation.
[quoted text, click to view] "Machi" <anonymous@discussions.microsoft.com> wrote in message
news:91A83811-97A6-4DF6-A09C-07A4618CFBE8@microsoft.com...
> let say i have a web form with a button on it ... when i click the button,
it will pop up one small window to allow me to save a pdf file, everything
is done using code behind as below ... however, in javascript, i have set a
global variable as a flag to indicate the number of times user click the
buttion (let say flagNoOfClick), when user clicks the button once, it will
set the flag (flagNoOfClick) to "true" (by using javascript). So, when user
tries to click the button again before the first click process is finished,
message box will pop up (by using javascript too) ... However, after the web
form finishes the code behind as below, i want to set the flagNoOfClick to
"false" from code-behind, can i do that from code-behind after
"Response.End();" ???
[quoted text, click to view] > My question is basically, can i access javascript global variable from
code-behind and modify the variable's value????
> thank you so much ....
>
============================================================================
=
[quoted text, click to view] > Response.Clear();
> Response.AddHeader("content-disposition", @"attachment; filename=" +
strFilenm + "");
> Response.ContentType = "application/pdf";
> Response.OutputStream.Write(btDownload,0,btDownload.Length-1);
> Response.End();