Home
News
Weblog
Kompetenzen
Referenzen
Media
Unternehmen
Kontakt

Archive for the ‘ASP.NET Controls’ tag

PartialUpdatePanel updated

with one comment

I just created a new release and uploaded it to CodePlex.

The feature improvements are for now

  • Fixed some issues with the control hierarchie
  • ScriptManager gets initialized with all properties from the parent page
  • More Controls from AJAXControlToolkit work, yes even the ModalPopupExtender!

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:

  • Autonomous sections of your page that require PostBack-support but not the environment information of the entire web page (e.g. data lists with paging support where the user can browse through news, feeds, mails, etc.)
  • User feedback when your control has to complete long operations. In this case use a PartialUpdatePanel with render method “Clientside”. The surrounding page will be displayed with a waiting message. The user will receive an adequate feedback that something is going on and he needs to wait until it is done.

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

Written by Stefan Schwedt

Januar 16th, 2009 at 7:36 pm

PartialUpdatePanel updated

without comments

PartialUpdatePanel got some massive improvements in the current release!
Here are some of them

  • Added encryption support for UserControl path
  • Added support for custom ScriptManager types (includes ToolkitScriptManager)
  • Added support for ToolkitScriptManager.CombineScriptsHandlerUrl
  • Change UserControlPath using JavaScript during runtime
  • Manipulate Parameters serverside during roundtrip
  • Fixed issue using validators and rendering in Clientside mode
  • Fixed a bug with recreating components
  • Added some more demos to show the new features

Attention: If you use this version, you have to make some changes in your code:

  • web.config: Add (with user defined value of course)
    <appSettings> 
        <add key="PartialUpdatePanel.EncryptionKey" value="k39#9sn1"/> 
    </appSettings>
  • The use of parameter collection changed.
    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: PartialUpdatePanel 1.6.

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:

  • Autonomous sections of your page that require PostBack-support but not the environment information of the entire web page (e.g. data lists with paging support where the user can browse through news, feeds, mails, etc.)
  • User feedback when your control has to complete long operations. In this case use a PartialUpdatePanel with render method “Clientside”. The surrounding page will be displayed with a waiting message. The user will receive an adequate feedback that something is going on and he needs to wait until it is done.

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

Written by Stefan Schwedt

November 14th, 2008 at 1:45 pm

Solution for FindControl with MasterPages

with 7 comments

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;

Written by Stefan Schwedt

Oktober 10th, 2008 at 3:41 pm

Posted in ASP.NET

Tagged with , ,

PartialUpdatePanel updated

without comments

You can find an updated version of the PartialUpdatePanel ASP.NET-Control here: PartialUpdatePanel 1.5.4.

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:

  • Autonomous sections of your page that require PostBack-support but not the environment information of the entire web page (e.g. data lists with paging support where the user can browse through news, feeds, mails, etc.)
  • User feedback when your control has to complete long operations. In this case use a PartialUpdatePanel with render method “Clientside”. The surrounding page will be displayed with a waiting message. The user will receive an adequate feedback that something is going on and he needs to wait until it is done.

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

Written by Stefan Schwedt

September 29th, 2008 at 6:04 pm