UserControl Radwindows AjaxRequest

2 posts, 0 answers
  1. Jean-Marc
    Jean-Marc avatar
    93 posts
    Member since:
    Mar 2011

    Posted 12 Apr 2012 Link to this post

    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
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 16 Apr 2012 Link to this post

    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
Back to Top