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

Call a javascript function to the page load event

6
Hi everyone,

I am developing a website using asp.net with C#.

And I developed a toolbar using javascript like google and yahoo toolbar which is placed in the browser separately.

Toolbar has the toolbar id.

I need to capture the toolbar id and save into the mysql database during the page load.

So that, I put the javascript funcation called myFunc() in the Source file of the page to capture the toolbar id.

I need to save the toolbar id into the mysql database and so I applied the coding to insert the toolbarid into the database.

When I execute the coding, first of all, the page is loaded, then only the javascript is executed. Therefore, I am unable to get the toolbar id to the variable assigned in the page load.

Please help me regarding this.

How do I call the javascript function to the page load event.


Thanks in Advance,

J. Mohan.
May 17 '08 #1
1 1684
EinToR
20
I don't beleive there's a way to do what you want the way your doing it unless you:

1) Use ajax to pass the value from myFunc() to a seperate server-side page "page.aspx"

2) "page.aspx"could take myFunc(), Session.SessionID, and the DateTime and insert it into a mysql table. In MSSQL there's a default value where you can put getdate(). I'm assuming mysql isn't that much different.

//Here's where I'm not sure. I don't remember the Event order...
3) In a page event, you can get the value you want by:

//psudo code
Expand|Select|Wrap|Line Numbers
  1. select myFuncVal 
  2. from tableName
  3. where SessionID = Session.SessionID
  4. order by DataTimeField desc
May 17 '08 #2

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

Similar topics

3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
2
by: shree | last post by:
Hi all, I'm trying to call javascript function via onLoad but running into a problem. I would appreciate any help and suggestion. My application is as follows. When a page loads, I want to check...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
3
by: Fresno Bob | last post by:
I have a page which is a master page. I want to trigger a Javascript function in the onload event of the body. Simply attaching an onload event to the body which points to javascript function...
4
by: faraz | last post by:
I have a javascript function that i want to call masterpage load method called. I cant add onLoad event of body or table in master page. I have put the call to script function in <form>, it...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
5
by: =?Utf-8?B?TWF0Y29u?= | last post by:
Hello, I have a asp.net 2.0 (vb.net) page, which uses a master page, and there is a javascript function (myfunction) defined in the <headof that master page. Is there a way to run the function...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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
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...
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...

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.