Calling Javascript from codebehind...

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top