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

[Solved] How to set UpdateAlways="true" for RadAjaxPanel

4 Answers 227 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Raviraj
Top achievements
Rank 2
Raviraj asked on 04 Apr 2009, 07:27 AM
Hi All,

I have one hidden field in master page. I have created the property for this hidden field so that I am able to update the value of this hidden field from content page.
It works fine when there is no RadAjaxPanel in content page.
But if event get fired with the controls which are inside RadAjaxPanel in content page then the value of hidden field dosent get updated.
I have palced the hidden field in another RadAjaxPanel but still it is not working. In Update panel there is one property i.e. UpdateMode = "Always". I didn't found such property in RadAjaxPane. I just want,  hidden field should get updated for every sync or async postback always.

4 Answers, 1 is accepted

Sort by
0
Raviraj
Top achievements
Rank 2
answered on 07 Apr 2009, 06:37 AM

 If there is no such property then Is there is any to do this?.

How Updatepanel behave when  UpdateMode = "Always". Is there is any script added along with update panel so it will update itself whenever there is asynchronous request to server.

I am familiar with update panels but not with RadAjaxPanel, but it's requirement.
0
Sebastian
Telerik team
answered on 07 Apr 2009, 06:50 AM
Hello Raviraj,

To achieve your goal you need to wire the OnAjaxSettingCreating event and set the UpdateMode property of the update panel which is about to be generated. Here is a code snippet which illustrates the approach:

protected void RadAjaxPanel1_AjaxSettingCreating(object sender, AjaxSettingCreatingEventArgs e)   
{    
   if(<some condition>)  
   {  
        e.UpdatePanel.UpdateMode = UpdatePanelUpdateMode.Always;   
   }  
}   
   
 

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Raviraj
Top achievements
Rank 2
answered on 07 Apr 2009, 09:56 AM
Hello Sir,

  First Thank you for your response.

but I am unable to find the OnAjaxSettingCreating event for the RadAjaxPanel.

The details are as below

The assembly version of telerik controls is 1.7 i.e. following tag is added in web.config.

<add tagPrefix="radA" namespace="Telerik.WebControls" assembly="RadAjax.Net2, Version=1.7.0.0, Culture=neutral, PublicKeyToken=3f7b438d1c762d0b"/>

The code in master page is as below.

 <radA:RadAjaxPanel ID="pnlHiddenFields" runat="Server">
            <asp:HiddenField ID="hdnDirtyFlag" runat="server" Value="0" />
</radA:RadAjaxPanel>
and I have created the property to access the hidden field hdnDirtyFlag from content page which may contain another RadAjaxPanel and control events of which modify the value of hidden field. The property is as below.
    public bool IsPageDirty
    {
        get { return (hdnDirtyFlag.Value == "1" ? true : false); }
        set { hdnDirtyFlag.Value = (value ? "1" : "0"); }
    }

Is there is any another way? or am I making mistake somewhere?

0
Sebastian
Telerik team
answered on 07 Apr 2009, 10:22 AM
Hi Raviraj,

My reply is applicable for RadAjaxPanel which is part of RadAjax for ASP.NET AJAX (your message is posted in that forum on our site). It seems that you are using the ASP.NET version of RadAjax which uses different internal mechanism which is not based on ASP.NET AJAX and MS UpdatePanels.

Hence if the solution you found is applicable, feel free to use it in your scenario.

Greetings,
Sebastian
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Raviraj
Top achievements
Rank 2
Answers by
Raviraj
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or