Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
Can't get RegisterPostBackControl to recognize button in a dynamic template
posted

What I am doing is creating a custom pager control, which I add dynamically to all of my WebDataGrids.  In that control, I have a button that fires a WebExcelExporter to export the contents of the grid to Excel.  Problem is, my grid is in an UpdatePanel and I need to do a full postback.  Problem is, when I do RegisterPostBackControl on that button, it has no effect.  It seems to work fine if I just put the button in PagerTemplate on the page and get it with FindControl, but it won't work if I add the template dynamically or in my custom control either way.  It also used to work fine when I had my custom pager in a user control.

 

Any idea why it is behaving like this?

 

Parents
  • 37874
    posted

    Hi jbirzer,

    You should make sure the RegisterPostBackControl method is called after the initialization of the templated button. Let me know if this helps.

Reply Children
No Data