473,654 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access javascript's variable from code-behind

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() ;" ??
My question is basically, can i access javascript global variable from code-behind and modify the variable's value???
thank you so much ...
=============== =============== =============== =============== =============== =
Response.Clear( )
Response.AddHea der("content-disposition", @"attachment ; filename=" + strFilenm + "")
Response.Conten tType = "applicatio n/pdf";
Response.Output Stream.Write(bt Download,0,btDo wnload.Length-1);
Response.End();
Nov 18 '05 #1
1 9123
You can do it the other way, this may help. For example, in your JavaScript
block:

newwindow=windo w.open("<%=sPop upedWindow%>");
</SCRIPT>

and in the codebehind:

Protected sPopupedWindow As String = ""

You can adapt this to your situation.

"Machi" <an*******@disc ussions.microso ft.com> wrote in message
news:91******** *************** ***********@mic rosoft.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() ;" ??? My question is basically, can i access javascript global variable from code-behind and modify the variable's value???? thank you so much ....
=============== =============== =============== =============== =============== =
= Response.Clear( );
Response.AddHea der("content-disposition", @"attachment ; filename=" + strFilenm + ""); Response.Conten tType = "applicatio n/pdf";
Response.Output Stream.Write(bt Download,0,btDo wnload.Length-1);
Response.End();

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4012
by: Nick | last post by:
I've a main html file which will pop up a window with a image. In the main Window, I have the following code: w = window.open('popup.html') alert(w.document.images.length) And the alert shows 0. However, there is a image in the popup window and an alert(document.images.length) in the popup html file shows 1.
2
13545
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <% Session("var1") = "Hello" %> And then when I click on a button it refers to the include file, which I believe is all client-side code as there are no server <% %> tags.
6
5127
by: Denis | last post by:
I am trying to launch an .mdb file via javascript. I do not need to do anything but open the application. It is able to open the application but for some reason it opens and then closes. At first I thought it may be a permission problem as far as writing the .ldb file to disk, but I added every single user and gave them write permissions to the folder and there is still no change. Has anyone been able to get this to work? Thanks in...
2
3024
by: stephane | last post by:
Hi all, What I am trying to achieve is an 'inherits' method similar to Douglas Crockford's (http://www.crockford.com/javascript/inheritance.html) but that can enable access to the superclass' priviledged methods also. Do you know if this is possible ? In the following example, I create an ObjectA (variable a), an ObjectB which inherits ObjectA (variable b) and an ObjectC which inherits ObjectA (variable c1). The 'toString ()' method...
2
3048
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is what I'm hoping to achieve. I've never before had to use Javascript closures, but now I do, so I'm making an effort to understand them. I've been giving this essay a re-read: http://jibbering.com/faq/faq_notes/closures.html
11
16929
by: Rob | last post by:
I know, I know, don't use frames. Well, I'm stuck with these frames and I'm trying to add functionality without a complete redsign. You can look at this as a nostalgic journey. Anyway, I've got the following frame structure at the top level: FRAMESET CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html><head><title>Server List</title></head> <frameset frameborder="1" border="1" framespacing="1" rows="10%,89%">
2
1941
by: wilkinson.philip | last post by:
I have a javascript object which dynamically generates a table adding, deleting and moving rows as the user clicks on buttons or links. Problem is when I generate a table row and add the javascript method call to my class, I have to put the object instance name variable of the class in order for it to be called from the onclick=function(). This is seriously limiting, but I'm stuck for a way round it. Heres a edited of the code so you get...
7
2943
by: tshad | last post by:
How do you hide an asp.net object and still be able to access it? I had my email in a session variable, but you can't access the session variable from Javascript (I don't think - since Javascript is Client and Session is Server). I tried using the email that was on the page, but it was surrounded by a Panel that had its visible property set to false - so anything inside of the Panel was not on the page.
7
2022
by: JDOMPer | last post by:
Don’t misunderstand me – I use AJAX, but I think there is a far simpler, elegant alternative that just uses Javascript, the DOM and Php ( hence - JDOMP) for data transfers, and is cross-browser without the need for work arounds. JDOMP works in recent versions of Explorer, Mozilla, Safari and Opera. Please note I will not deal with security issues which are always an issue whenever there is access to a database. You can simply change text on...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1596
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.