Wednesday, March 21, 2012

A ContentTemplate must be specified for UpdatePanel

Why has the Update Panel been changed in the new release so that a ContentTemplate must be specified. In my project i'd like to dynamically add controls to the panel in a user control.

Is this something that that is permanent?

Do not confuse the ASP.NET Panel control with the ASP.NET "Atlas"UpdatePanel.The ASP.NET "Atlas"UpdatePanel is a new control able to do partial rendering

In typical ASP.NET 2.0 applications, when a postback occurs, the page is re-rendered. This causes the page to flash in the browser. On the server, during postback, the page lifecycle executes. This ultimately raises the control event that caused the postback and runs the event handler (for example, a Button control's Click handler).

The ASP.NET "Atlas"UpdatePanel control eliminates the full page refresh. TheUpdatePanel control is used to mark a region in the page that will be updated when a postback occurs, but without the traditional postback behavior in the client. On the server, the page still handles the postback and runs normally, such as raising event handlers. But during the final rendering of the page, only the regions defined byUpdatePanel controls are created. This is referred to aspartial rendering.

Hope this helps

Irinel


I have a webpart server control class that i have extended. i'd like to add a update panel around the contents of the webpart so i can derive from this new class which has all the functionaly of webpart but its contents is with in an update panel.

I'd this like to add webparts derived from this extended class and add them dynamically to page via database.

I was having problems with the fact that u can not directly add controls to an update panel by adding controls i've solved this problem by deriving a class from ITemplate and then adding the template to the content template of the update panel.

I now have the problem the following problem

"The UpdatePanel 'Update' was not present when the page's InitComplete event was raised. This is usually caused when an UpdatePanel is placed inside a template. "

which i'm not saw how to resolve.

I've had success with a update panels dynamically around dynamically added webpartzones with in the onpreint event.

Any help would be appreciated.

Thanks

Paul

No comments:

Post a Comment