Calling Javascript from codebehind...

G

Guest

hiye people, i know this have been ask multipletimes over the past year, but i cant find any here in the new group so here goes..

in my code behind, i'm going to do some validation and use javascript to throw the msg out to them, these errors msg are query from the db
1st, how can i call a javascript function from codebehind. is there any other way besides response.write = "<script></script>" ??
2nd, can someone recommend me ways i can pass parameters from codebehind into my javascript

thanks in advance..

Zuiber
 
J

John Saunders

Ekken Zuiber said:
hiye people, i know this have been ask multipletimes over the past year,
but i cant find any here in the new group so here goes...
in my code behind, i'm going to do some validation and use javascript to
throw the msg out to them, these errors msg are query from the db.
1st, how can i call a javascript function from codebehind. is there any
other way besides response.write = said:
2nd, can someone recommend me ways i can pass parameters from codebehind
into my javascript?

You can't do this directly. Client-side JavaScript resides on the client,
and server-side codebehind resides on the server. The only connection
between the two is that the server code gets to write HTML to the client.
You will have to write <script/> to the client.

You can pass values to the client by placing those values in the script code
which you send to the client.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top