473,394 Members | 1,785 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,394 software developers and data experts.

Pass a Value from Page_Load to a Java Function

Is this possible???

When i call another web page i receive a value from it:

Expand|Select|Wrap|Line Numbers
  1. //1st Page
  2. Session["nCam"] = camLenght;
Expand|Select|Wrap|Line Numbers
  1. //2nd page -> receive the value from the first page on Page_Load()
  2. int nCam = Convert.ToInt32(Session["nCam"]);
then i call a java function from the body tag:

Expand|Select|Wrap|Line Numbers
  1. <body onload="MontagemCamaras()">
The question is: is that possible to use the value from the second page to be an input for the java function?? how can i do it???

Tell me if i wasnt quite clear on this. Thanks in advance.
Jun 3 '08 #1
3 1938
DrBunchman
979 Expert 512MB
Hi Rambaldi,

I presume as we are discussing web development that by Java you actually mean Javascript?? There is a massive difference between the two and it's important to be precise about it.

Assuming that you do mean Javascript then you can pass a variable into your javascript function using the server tags (<% %>) like this:

Expand|Select|Wrap|Line Numbers
  1. <body onload="MontagemCamaras(<%=nCam%>)">
Hope this helps,

Dr B
Jun 3 '08 #2
Hi DrBunchman, thanks for your reply.

I mean Javascript, I’m sorry. In my country, we just say Java to abbreviate. I will be more careful when i put my questions in foreign forums.

Thanks for your answer, it helps me a lot :D
Jun 3 '08 #3
DrBunchman
979 Expert 512MB
No problem Rambaldi, glad it helped.
Jun 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: kaiwing18 | last post by:
Hi, I have a following jsp file called "showAsset.jsp" : <form action="showAsset.jsp" method="post"> <tr BGCOLOR=YELLOW> <td><input name="sort" type="submit" value="Asset_Number" > </td>...
38
by: Radde | last post by:
HI all, Whats the difference b/w pass by ref and pass by pointer in C++ when ur passing objects as args.. Cheers..
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
3
by: Allan Lembo | last post by:
Hi Folks If I create a new instance of an object within a method how can I pass it back by reference? For example, the following code, in the context of an ASP.NET page, returns "Original...
0
by: ab_j | last post by:
I have a user control that contains a dropdown which I want to use as a menu on multiple .aspx pages. Basically, all I am trying to do is pass the selected value of the dropdown in the user...
3
by: Boki | last post by:
Hi, Could you please advice, can javascript accept this kind of code? function resone(cnt) { alert("document.all.txt_note"+cnt) // cnt is the textbox index
0
by: Jon Paal | last post by:
how can I pass conventional html upload form to asp.net page for processing / like : (which currently does not work) <form name="userForm" action="upload.aspx" ENCTYPE="multipart/form-data"...
10
by: Robert Dailey | last post by:
Hi, I noticed in Python all function parameters seem to be passed by reference. This means that when I modify the value of a variable of a function, the value of the variable externally from the...
1
by: kkshansid | last post by:
i want to pass both variables($q1 and value of select) from this php page to java script so that i can get both variables in second php file srt.php <script type="text/javascript"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.