PartialUpdatePanel updated
I just created a new release and uploaded it to CodePlex.
The feature improvements are for now
You can find an updated version of the PartialUpdatePanel ASP.NET-Control here:
PartialUpdatePanel 1.7.
So what is the PartialUpdatePanel?
The PartialUpdatePanel provides real partial rendering of ASP.NET pages. By using this control you can experience performance improvements compared to ASP.NET AJAX UpdatePanel, because not all page data needs to be transferred. Only a minimal set of data is being transported between the client and the server before your UserControl is made fully functionable.
Usage scenarios
Exemplary scenarios for the usage of the PartialUpdatePanel are:
More information and a version history can be found here:
http://www.codeplex.com/PartialUpdatePanel.
On codeproject I wrote an indepth technical article how the PartialUpdatePanel works:
http://www.codeproject.com/KB/ajax/PartialUpdatePanel.aspx
PartialUpdatePanel updated
PartialUpdatePanel got some massive improvements in the current release!
Here are some of them
Attention: If you use this version, you have to make some changes in your code:
new iucon.web.Controls.ParameterCollection()
is no longer supported. Use
iucon.web.Controls.ParameterCollection.Instance
instead
You can find an updated version of the PartialUpdatePanel ASP.NET-Control here:
So what is the PartialUpdatePanel?
The PartialUpdatePanel provides real partial rendering of ASP.NET pages. By using this control you can experience performance improvements compared to ASP.NET AJAX UpdatePanel, because not all page data needs to be transferred. Only a minimal set of data is being transported between the client and the server before your UserControl is made fully functionable.
Usage scenarios
Exemplary scenarios for the usage of the PartialUpdatePanel are:
More information and a version history can be found here:
http://www.codeplex.com/PartialUpdatePanel.
On codeproject I wrote an indepth technical article how the PartialUpdatePanel works:
http://www.codeproject.com/KB/ajax/PartialUpdatePanel.aspx
Solution for FindControl with MasterPages
Imagine you have the following declaration
<asp:Content ContentPlaceHolderID="plcMainContent" ID="cntMain" runat="server"> ... <asp:Panel id="pnlThumb1" runat="server" Visible="true"/> ... </asp:Content>
and you are calling in your CodeBeside
this.pnlThumb1.Visible = false;
it will simply work without any problem.
Now think about changing your call to
this.FindControl("pnlThumb1").Visible = false;
what happens? You will get a NullReferenceException!
What you can do is first get a reference to your Content and second make a FindControl call:
ContentPlaceHolder mainContent = (ContentPlaceHolder)this.Master.FindControl("plcMainContent"); mainContent.FindControl("pnlThumb1").Visible = false;
This works, but this workaround is not very elegant.
We can get more elegance to our code by using reflection and a simple extension class.
The basic idea behind the following code is, that ASP.NET generates protected Control declarations for every control in the page. So we can get references to the controls by reflecting into the class instead of using FindControl.
public static class PageExtensions { public static T GetControl<t>(this Page page, string name) where T : Control { FieldInfo field = page.GetType().GetField(name, System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); if (field != null) return (T)field.GetValue(page); return null; } }
The usage now is quite simple:
this.GetControl<panel>("pnlThumb1").Visible = false;