Client Side Code From Server Side Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a button that runs some server code when clicked. Is it possible to
also have it run some client side java script?

The setup is i have a tree menu in the left frame and the data in the rigth
frame. There is a level up button which allows the user to go one level up
in the tree. I have the server side code working so that the right frame
updates, however, i need to tree to also resync itself.

Any suggestions?
thanks.
 
In your event handler(server code), you just need to push some script out to
take action. Depending on when you want the client script to execute you can
put the script code on the control itself using registerclientscript or its
cousin (forgot the name at the moment) or if you want the script to execute
after the server side code, do something like
event handler code
{
Response.Write("<script>put some script code here</script>");
}

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
Back
Top