1.You need to define an event handler in user conrol as shown below.
public partial class UC_Pagination : System.Web.UI.UserControl
{
...
...
public event EventHandler PageIndexChanged;
...
...
...
}
2. You need to call the event explicitly in the user control's implementation of the event handler of button click as shown here
public partial class UC_Pagination : System.Web.UI.UserControl
{
...
...
protected void Button1_Click(object sender, EventArgs e)
{
...
...
PageIndexChanged(sender, e);
...
...
}
...
...
...
}
3. Implement the event handler bubbled up by user control in the parent page/control in its own way as usual (shown below).
public partial class Coaches : System.Web.UI.Page
{
...
...
protected void ucPaginationPageIndexChanged(object sender, EventArgs e)
{
...
...
...
}
...
...
}
1 comments:
Good. Nice one.
Post a Comment