Click to See Complete Forum and Search --> : call javascript function to the page load event


jmohan
05-17-2008, 02:20 AM
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.:)

DarkBob
05-18-2008, 06:49 AM
Hi J,

Because of the architecture of .Net you can't add parameters to the page load function. If you want to get some data from the client at the page load stage you need to either add a querey string or post information with the http request.

I'm guesing that you're using the toolbar to make the request for the web page so I'd recommend using the querey string as if they bookmark it, it'll still send the toolbar id.

Another option would be client callbacks, remote scripting or live connect but they would all only be usable when the page is loaded.

jmohan
05-19-2008, 12:44 AM
Hi J,

Because of the architecture of .Net you can't add parameters to the page load function. If you want to get some data from the client at the page load stage you need to either add a querey string or post information with the http request.

I'm guesing that you're using the toolbar to make the request for the web page so I'd recommend using the querey string as if they bookmark it, it'll still send the toolbar id.

Another option would be client callbacks, remote scripting or live connect but they would all only be usable when the page is loaded.

Thank you very much for your reply,

I have got the solution by query string.

could you please guide me to capture the toolbar id in three ways callbacks and remote scripting and live connect elaborately.

I can get the solution for this problem and future problems.

great ! your answers !

Thanks in Advance.
J. Mohan.
:)