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

RadAjaxManager and DNN philosophy

5 Answers 118 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
possible
Top achievements
Rank 1
possible asked on 20 May 2008, 09:18 AM
Hi..

I'm migrating my old modules to new version with new telerik ajax controls and I need some advices how to do it best.
At the moment I have radajaxmanager embedded in skin (skin is always one per page, so this doesnt make any problems).
Now the problem, the typicall situation in my modules:

a) users press button and in client or server side I display radconfirm
b) if user presses yes ajaxrequest is made to call server side code,
c) server side code is executed and it displays radalert with notifaction or response.redirect is made to back to main screen.

How to do it best with new ajax controls? How to use radajaxmanager and radajaxproxy?

Thanks for all info
Regards

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 May 2008, 11:55 AM
Hi tspossible,

Reading about your scenario, I do not find any changes that are needed to migrate this from the code you've used with the Classic version. Have you hit any problems and what is bothering you?

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
possible
Top achievements
Rank 1
answered on 20 May 2008, 01:25 PM
Hi,

I have two main problems..
a) client-side ajaxReqest.. how to determine which module have to be updated? i have to add ajaxManager as AjaxControlID in ajaxsettings and every pane as updatecontrols but this is not a good solution

b) I have embedded links to css files in my modules
<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
    <link href="<%= BizPlatform.Utilities.Common.GetCSSName(PortalSettings.HomeDirectory,"WorkTime") %>" type="text/css" rel="stylesheet" />

And when i try to update it content via ajaxmanager i get such exception..

The script tag registered for type 'System.Web.UI.Page' and key 'dnn$ctr374$EditProjects$ctl00' has invalid characters outside of the script tags: <link href="/biz/Portals/0/Projects/skin.css" type="text/css" rel="stylesheet" />
0
Maria Ilieva
Telerik team
answered on 23 May 2008, 02:31 PM
Hi,

Please review the following post, which elaborates on this matter. Check the posted information and let us know if this helps.

Best wishes,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
possible
Top achievements
Rank 1
answered on 24 May 2008, 05:57 AM
Hi,

No, this post doesnt have anything common with my problem. I'll ask again with more precise question.
Assume that I have 2 modules
- Module A: where I use ajaxRequest from client side,
- Module B: where I also use ajaxReqest from client side.

Now, when I call ajaxRequest from Module A i want only to update body of this module, not the whole page. How to setup ajaxSettings? Becouse the updatecontrol is always ajaxManager and thats the problem.

Regards
0
Maria Ilieva
Telerik team
answered on 27 May 2008, 07:43 AM
Hi tspossible,

In order to update only the controls in the particular module, you should wrap them in a container and add this container in the RadAjaxManager settings.

Here is a sample example how you could proceed with the AjaxRequest:
<script runat="server"
 
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        if (e.Argument == Button1.ClientID) 
        { 
            RadAjaxManager1.AjaxSettings[0].UpdatedControls[0].ControlID = Label1.UniqueID; 
            RadAjaxManager1.AjaxSettings[0].UpdatedControls[1].ControlID = ""
        } 
        else if (e.Argument == Button2.ClientID) 
        { 
            RadAjaxManager1.AjaxSettings[0].UpdatedControls[0].ControlID = ""
            RadAjaxManager1.AjaxSettings[0].UpdatedControls[1].ControlID = Label2.UniqueID; 
        } 
 
        Label1.Text = Label2.Text = DateTime.Now.ToString(); 
    } 
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
        <script type="text/javascript"
        function ajaxRequest(id) 
        { 
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(id); 
        } 
        </script> 
 
    </telerik:RadCodeBlock> 
</head> 
<body> 
    <form id="form1" runat="server"
        <div> 
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="Label1" /> 
                            <telerik:AjaxUpdatedControl ControlID="Label2" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <asp:Button ID="Button1" runat="server" OnClientClick="ajaxRequest(this.id); return false;" 
                Text="Button1" /> 
            <asp:Button ID="Button2" runat="server" OnClientClick="ajaxRequest(this.id); return false;" 
                Text="Button2" /> 
            <asp:Label ID="Label1" runat="server"></asp:Label> 
            <asp:Label ID="Label2" runat="server"></asp:Label> 
        </div> 
    </form> 
</body> 
</html> 
 



Greetings,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
possible
Top achievements
Rank 1
Answers by
Steve
Telerik team
possible
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or