Monday, May 31, 2010

SharePoint Web Part and JavaScript–Add Client Event

I have written a post about how to add script to the SharePoint Web Part. Here I am trying to add a client event to a button or checkbox.

1. Add the the script to web part as my previous post.

2.In this case, I want to a click event for a button. You do it like below:

You already implemented a showinformation function and added it  to your web part, and used the ClientID of the control as a parameter. You can see that I put the initialization in the OnPreRender() function, I haven’t tried to put in other functions, you can have a try by yourself.

These are what you need do.


No comments:

Post a Comment