Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX.WrapUpdatePanelControl - Page life cycle timing is everything!AJAX.WrapUpdatePanelControl - Page life cycle timing is everything!
Previous
 
Next
New Post
11/14/2007 8:17 PM
 

Today for the first time I had the occasion to use the DotNetNuke.Framework.AJAX.WrapUpdatePanelControl in a module control that had just one section that would benefit nicely from AJAX. As I had seen an example somewhere showing this new (DNN 4.5.2) method called in a module control's Load event handler, that's where I put it (along with the usual call to AJAX.RegisterScriptManager).

I then found that I was having problems with a checkbox that would remain checked visually but which was loosing track of its Checked property in code and a DropDownList control not retaining its viewstate and hence not firing its SelectedIndexChanged event. Both these controls initially had their visibility set to false in the .ascx and were being revealed in response to asynch postbacks. Knowing that dynamically loaded controls should usually be created as early as possible in the page life cycle, I then moved the creation of the UpdatePanel into the Init event handler. All began working as it should.

Tip for the day - call WrapUpdatePanelControl in the Init not Load event handler:

Protected Sub ListEditor_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        If DotNetNuke.Framework.AJAX.IsInstalled Then
            DotNetNuke.Framework.AJAX.RegisterScriptManager()
            DotNetNuke.Framework.AJAX.WrapUpdatePanelControl(Me.pnlUpdate, True)
        End If
End Sub

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
11/15/2007 12:19 PM
 

That is a good recommendation actually!

However, I believe you would want to ensure that it only gets called on the first page load though?  As init is called on every postback?  (I might be wrong...)


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
11/15/2007 5:33 PM
 

I'm was quite certain that you would need to call AJAX.WrapUpdatePanelControl on both initial load and all postbacks as well which makes sense knowing that any dynamically created controls must be re-created (but not re-populated or re-databound) each cycle. 

To test this, I just created a test module which wrapped a panel containing an auto-postback dropdownlist and a textbox with a dynamically created UpdatePanel on each and every load event. Each time I selected an item in the dropdownlist it's value appeared in the textbox as designed without a full postback.

I then moved calling AJAX.WrapUpdatePanelControl into an Not IsPostback block so that it would be called only on the first load. The first time an item was selected in the dropdownlist it appeared in the textbox with an asynch postback without a complete rendering of the page. The second and subsequent selections from the dropdownlist still displayed the selected value in the textbox but did so with a full postback and complete rendering of the page.

So much to learn about this AJAX "stuff" and so little information/tutorials available beyond the basics!


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
11/15/2007 5:53 PM
 

 have a sample here:

Ajax Email

Not too advanced but it's a full app.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
11/16/2007 10:45 AM
 

Michael Washington wrote

 have a sample here:

Ajax Email

Not too advanced but it's a full app.

Michael,

I see that you have it in the Page_Load and have no issues.  That is where I typically put mine as well, however, I guess I always did it under if(!isPostBack) so that it only did it once, and all of my examples work......am I possibly running a risk of it not working?


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX.WrapUpdatePanelControl - Page life cycle timing is everything!AJAX.WrapUpdatePanelControl - Page life cycle timing is everything!


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out