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

UserControl Radwindows AjaxRequest

1 Answer 75 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jean-Marc
Top achievements
Rank 1
Jean-Marc asked on 12 Apr 2012, 11:22 AM
I know a lot of discussion are about it, probably i'm dumb enough to not see how to use them for my case.

ASPX: contains a couple of ASCX (ASCX1, ASCX2). It needs a radajaxmanager
ASCX2: within I have a radwindow. as i close it I need to perform  an AjaxRequest

How to?

First, where do i place my javascript?

        function OpenNewsCategory(ID, SelCat) {
            var wnd = $find("<%=RadWindowName.ClientID%>");
            wnd.show();
            wnd.setUrl("mypgae.aspx?ID=" + ID);
        }

        function closeRadWindow(oWnd, args) {
            var arg = args.get_argument();
            var arguments;

            if (arg) {           
                 if (arg.Index != '') {                
                    arguments = arg.Index + "," + arg.bSender;
                    alert('closeRadWindow parameters ' + arguments);
                }  
                oWnd.argument = null;
            }

            ajaxManager.ajaxRequest('closeRadWindow' + arguments);
        }

Second, I would like to manage the servside code of ajaxrequest within the usercontrol and the javascript too. is it possibile?
do i need radajaxproxy? if it's so, how?

Thank you

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Apr 2012, 02:12 PM
Hello Jean,

Method 1 :

function ClientClose(oWnd, args) {
                
                    if (args.get_argument() != null) {
 
                        __doPostBack('<%= btnSaveAfterConfirm.UniqueID %>', '');
                    }
                 
            }
<asp:Button ID="btnSaveAfterConfirm" runat="server" OnClick="btnSaveAfterConfirm_Click"
style="display: none;" />
protected void btnSaveAfterConfirm_Click(object sender, EventArgs e)
        {
// do your logic here
}

Method 2:
Check below link / Demo.
Client side Ajax request


Thanks,
Jayesh Goyani
Tags
Ajax
Asked by
Jean-Marc
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or