I have a web part containing a repeater control which display the announcements. I want to make a custom tool part which enables a user to limit the number of rows of repeater. I have created a text box that takes the number of news to display as an input. Now I am confused that how do I bind its event with the 'Ok' button i.e. when the button is pressed the code should render the input and make the repeater accordingly. Here is my code:
[WebBrowsable(true),
WebDisplayName("Number of announcement to display"),
WebDescription("Controls number of announcement"),
Category("Content Control"),
Personalizable(PersonalizationScope.Shared)]
public int NumberofAnnouncement
{
get;
set;
}
How do I bind the event ? I need some assistance.
Ok. I'm assuming that you have created a visual webpart and your code is added like this in webpart class.
Now in the UserControl Class add below code
Default value for the numberofannouncements will be 10. And can be updated through edit webpart properties. Hope this will help you