473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Pass ASP.NET/VB.NET variable to javascript

I don't think this is possible, but here goes.

I have a webform containing a javascript method. The javascript method is
fired when the page loads and it populates some client-side input controls.
In the code's page load event, data populates into some server-side controls.

When the page load event occurrs, can I somehow pass a variable to the
javascript method and reexecute the javascript method (remember it was
already executed once when the page loaded). Is this possible?

I'm using ASP.NET 2.0 with AJAX.

Thanks,
Mike
Jan 15 '08 #1
2 7222
"Mike" <Mi**@discussions.microsoft.comwrote in message
news:4C**********************************@microsof t.com...
>I don't think this is possible, but here goes.

I have a webform containing a javascript method. The javascript method is
fired when the page loads and it populates some client-side input
controls.
In the code's page load event, data populates into some server-side
controls.

When the page load event occurrs, can I somehow pass a variable to the
javascript method and reexecute the javascript method (remember it was
already executed once when the page loaded). Is this possible?
I don't see why not. You won't need to execute the javascript yourself,
because the server side processing will run first, and then the client side
load event will fire. It will always fire after a postback has occured. The
fact it already fired once is irrelevant.

Jan 15 '08 #2
This may help you:

How to Pass Messages and Actions between Server and Client
http://usableasp.net/DeveloperPage.a...rAndClient.htm

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Mike" <Mi**@discussions.microsoft.comwrote in message
news:4C**********************************@microsof t.com...
>I don't think this is possible, but here goes.

I have a webform containing a javascript method. The javascript method is
fired when the page loads and it populates some client-side input
controls.
In the code's page load event, data populates into some server-side
controls.

When the page load event occurrs, can I somehow pass a variable to the
javascript method and reexecute the javascript method (remember it was
already executed once when the page loaded). Is this possible?

I'm using ASP.NET 2.0 with AJAX.

Thanks,
Mike

Jan 15 '08 #3

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

Similar topics

1
by: Stefano | last post by:
Posted: Fri Jan 23, 2004 3:59 pm Post subject: Variable Javascript -------------------------------------------------------------------------------- Hi all, i have a problem with...
5
by: GB | last post by:
Hello: In my MS Access project I have two objects - my form and my report. I need to pass variable value from Command_click procedure of my form to Report_open procedure of my report. How can I...
1
by: Ben Kial | last post by:
I'd like to write a wrapper function "mysprintf(char *buffer, char *format, ....)" which calls sprintf(). My question is how can I pass variable argument in mysprintf() to sprintf(). Thanks in...
1
by: dollar | last post by:
I want to ask what is the best way to pass variable between asp.net we pages, and user controls , any examples - dolla -----------------------------------------------------------------------...
1
by: vijaynarang | last post by:
strCmdLine = " " + " -o restore -url " + sSitePath + "/sites/" + sToplevelSiteName + " -filename " + sFileName+ " -overwrite "; process1 =...
4
by: IRC | last post by:
hey, i am pretty new on javascript as well as PHP, Hey, anyone can you help me, how to pass the javascript array value to php page......... i want to retrieve the values which are arrayed on...
12
by: simon2x1 | last post by:
i have a page which is home.php on that page i have a CSS tab which is tab1 and tab2 on that page in both tabs i have a link called next that pass variable to the next page (<a...
7
gskoli
by: gskoli | last post by:
I have created a gif based digital clock but problem is that it will show me the client side time . I am a perl developer so i am getting server time, i mean , i can fetch that time , to pass the...
2
by: peachdot | last post by:
hi, The MainForm will have 2 buttons: 1.) Button A : User click button A, hide Mainform then go to form1. User enter data in the textbox.Click finish button,form1 close then go back to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.