Saturday, March 10, 2012

User Controls Events within UpdatePanel !

I have a similar issues. I am loking for help as well.

In general, async postbacks (UpdatePanels) should behave just like regular postbacks on the server, so your control should definitely go through its entire lifecycle (include page load). Have you tried setting a breakpoint to see if you're getting in there?

Have you tried removing the UpdatePanel(s) to see if the problem persists? It might not be related to AJAX?

Finally, you'll get more help if you're able to boil this down to a small sample that reproduces the issue and paste the code here.


Here is the post with my scenario. It contains a simple repo of the problem with code snippets.

http://forums.asp.net/thread/1613978.aspx


Hi Steve,

As you have mentioned, I have placed the break point and saw that the breakpoint is hitting within the user control. Then i included the Page_Init event to my user control and from there I populated my DropDown and Bingo its working now.

Now, there is another problem that we are facing. We also have our custom Ajax Control built using Ajax.NET Pro (by Michael Schwarz) and it is not firing from within the user control that is hidden initially (same scenario as i explained in my first post in this thread). But if the Custom control is visible initially, its showing the list.

Moreover we cannot go with the Ajax Drop down that comes with Microsoft Ajax.NET cause in our control, we maintain both Value and Text Part.

Please let me know if anything could be done about it.


I'm not sure about Ajax.NET specifically, but I assume it's injecting some JavaScript during the render phase of your control... that script probably isn't running because it's inside an UpdatePanel. My guess is that you can't use Ajax.NET controls in a partial rendering scenario (i.e. inside an UpdatePanel).

No comments:

Post a Comment