This is a migrated thread and some comments may be shown as answers.

Update label outside from RadAjaxPanel on asyncpostback

2 Answers 198 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
cuepack
Top achievements
Rank 1
cuepack asked on 19 Nov 2009, 08:20 AM

Hi together,
we have the following scenario in our Web Application.

Masterpage with 4 ContentPlaceholders, every page uses the masterpage.

We would like to update a label that is placed outside from the RadAjaxPanel.

Please look at the following code, in this case we click on "cmdTabOne" the
"cmdTabOne_Click" event fires fine and the "lblHeadline" label will be updated correct.
The Label "lblContextInfo" which is outside from the RadAjaxPanel will not updated.

<asp:Content ID="Content0" ContentPlaceHolderID="head" Runat="Server">  
    ...  
</asp:Content> 
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderPlaceHolder" Runat="Server">  
    ...  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="leftPanelPanel" Runat="Server">  
      
    <div> 
        <asp:Label ID="lblContextInfo" runat="server" Text=""></asp:Label> 
    </div> 
      
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="leftPanelContent" Runat="Server">  
          
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
          
        // Main Content  
        <div> 
            <asp:Label ID="lblHeadline" runat="server" Text=""></asp:Label> 
        </div> 
          
        <div> 
            <asp:LinkButton ID="cmdTabOne" runat="server" CssClass="Tab_active" onclick="cmdTabOne_Click">Tab One</asp:LinkButton> 
            <asp:LinkButton ID="cmdTabTwo" runat="server" CssClass="Tab_inactive" onclick="="cmdTabTwo_Click">Tab Two</asp:LinkButton> 
        </div> 
          
          
        </telerik:RadAjaxPanel> 
      
</asp:Content> 

  protected void cmdTabOne_Click(object sender, EventArgs e)     
  {     
     lblHeadline.Text = "Headline for Tab One";     
     lblContextInfo.Text = "Contextinfo for Tab One";     
  }     
       
  protected void cmdTabTwo_Click(object sender, EventArgs e)     
  {     
     lblHeadline.Text = "Headline for Tab Two";     
     lblContextInfo.Text = "Contextinfo for Tab Two";     
  }   

Any Ideas?

Thank you for your help.

Best regards

Günter

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 19 Nov 2009, 10:24 AM
Hello Cuepack,

RadAjaxPanel is a lightweight control that lets you update a part of your web page with AJAX while keeping the rest of the page working with postbacks.
To achieve the desired functionality you should use RadAjaxManager control, which offers a complete solution for turning a postback-based application into an AJAX-driven one
Please find more information in the following articles:
http://www.telerik.com/help/aspnet-ajax/manager-vs-panel.html
http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html

Kind regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
cuepack
Top achievements
Rank 1
answered on 20 Nov 2009, 04:29 PM

Hi Pavlina,

thank you for your quick response and your hints.
I got it managed with the RadAjaxManager and it works fine now.

Best regards.

Günter

Tags
Ajax
Asked by
cuepack
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
cuepack
Top achievements
Rank 1
Share this question
or