0

I have user control file cust_list.ascx

i have added this control to my aspx page. have two buttons in my aspx page..

during page_load I displayed 5 controls..

when i click on next button.it will show next 5 controls...i have previous button too.

my problem is when in click on button which is in user control after next button click the page set back to initial state.which is having situation same as when the first time page was loaded.but button_click in user control doesnt fire.

Adrian Iftode
  • 15,465
  • 4
  • 48
  • 73
kalpesh
  • 39
  • 1
  • 1
  • 4

1 Answers1

0

The below link might help you

https://stackoverflow.com/a/9080243/546033

There instead of HtmlGenericControl use your control like Button

Or else you need to load the user-control at Page_Load OR Page_Init so that the control events get registered like

Page_Load(object sender,EventArgs e)
{
createControls();
}

make sure to keep the function call out of if(!isPostBack) as it wont be able to click after postback.

hope this helps you....

Community
  • 1
  • 1
RohitWagh
  • 1,999
  • 3
  • 22
  • 43