Close RadWindow with Button

5 posts, 2 answers
  1. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 01 Dec 2011 Link to this post

    image Captura: the scenario
    I have a Grid, and a button named Full Edit. When click in Full edit, open a Radwindow.
    In Radwindow I have 3 buttons, Ones is Delete.

    When User Click in delete, appear a RadWindow.Confirm (Deelete this User?)
    If user click on Yes, remove user, close de windows and rebin the Grid.
    this problem is RadAjaxManager1_AjaxRequest does not exececute Close and Rebien of JS

    In save button, the user apply change, save and close (with intermidate windows) )this button wiorks.


    This is my code:
    .ASPX:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserForm.aspx.cs" Inherits="WebSearch.UI.Admin.UserForm" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>User</title>
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
        <link href="../Style/Admin.css" rel="stylesheet" type="text/css" />
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            function confirmCallBackFn(arg) {
                debugger;
                var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                if (arg == true)
                { ajaxManager.ajaxRequest("Remove"); }

            }

            function CloseAndRebind(args) {
                debugger;
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
            }

            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

                return oWindow;
            }

            function CancelEdit() {
                GetRadWindow().close();
            }


            function filterCreated(sender, args) {
                sender.get_contextMenu().add_showing(
                function (sender, args) {
                    sender.findItemByValue("IsNull").set_visible(false);
                    sender.findItemByValue("NotIsNull").set_visible(false);
                    sender.findItemByValue("GreaterThan").set_visible(false);
                    sender.findItemByValue("GreaterThanOrEqualTo").set_visible(false);
                    sender.findItemByValue("LessThan").set_visible(false);
                    sender.findItemByValue("LessThanOrEqualTo").set_visible(false);
                    sender.findItemByValue("NotBetween").set_visible(false);
                    sender.findItemByValue("Between").set_visible(false);
                }
            );
            }

                       
        </script>
        </telerik:RadCodeBlock>
    </head>

    <body>

     
         <form id="form1" runat="server">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"  />
                    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <div class="TabContainer">
            <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Vista" MultiPageID="RadMultiPage1"
                SelectedIndex="0" CssClass="tabStrip" Width="698px">
                <Tabs>
                    <telerik:RadTab value="Information">
                    </telerik:RadTab>
                    <telerik:RadTab  Value="Mandatory">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage">
                <telerik:RadPageView ID="RadPageViewInformation" runat="server" Width="100%">
                <div class="TabTitle">
                    <asp:Label ID="lblTitleTab2" runat="server"></asp:Label>
                </div>
                    <asp:Table ID="Table3" CssClass="EditFormTable" runat="server">
                        <asp:TableRow>
                            <asp:TableCell CssClass="CellLabelLTW">
                                <asp:Label runat="server" ID="lblFirstName" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxL">
                                    <asp:TextBox ID="txtFirstName" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("FirstName") %>'
                                        runat="server">
                                    </asp:TextBox><asp:RequiredFieldValidator ID="rfFirstName" runat="server" ErrorMessage="*"
                                        ControlToValidate="txtFirstName" CssClass="validator" ></asp:RequiredFieldValidator>
                                </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                    <asp:Label runat="server" CssClass="fontLabel" ID="lblLastName" /></asp:TableCell><asp:TableCell
                                        CssClass="CellTextBoxR">
                                        <asp:TextBox ID="txtLastName" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("LastName") %>'
                                            runat="server">
                                        </asp:TextBox><asp:RequiredFieldValidator ID="rvfLastName" runat="server" ErrorMessage="*"
                                            ControlToValidate="txtLastName" CssClass="validator"  ></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell CssClass="CellLabelLTW">
                                <asp:Label runat="server" ID="lblMiddleName" CssClass="fontLabel" />
                            </asp:TableCell><asp:TableCell CssClass="CellTextBoxR" >
                                <asp:TextBox ID="txtMiddleName" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("MiddleName") %>'
                                    runat="server">
                                </asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell ColumnSpan="2"></asp:TableCell></asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell CssClass="CellLabelL">
                                <asp:Label runat="server" ID="lblLoginId" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxL">
                                    <asp:TextBox CausesValidation="true" ID="txtLoginId" MaxLength="250" CssClass="TextBoxPopUp"
                                        Text='<%# Bind("LoginId") %>' runat="server">
                                    </asp:TextBox><asp:RequiredFieldValidator ID="rfvLoginId" runat="server" ErrorMessage="*"
                                        ControlToValidate="txtLoginId" CssClass="validator"></asp:RequiredFieldValidator>
                                    <asp:CustomValidator ID="cvLoginId" runat="server" ControlToValidate="txtLoginId" ValidationGroup="Information"
                                        CssClass="validator" ValidateEmptyText="True" Display="Dynamic" OnServerValidate="cvLoginId_ServerValidate"></asp:CustomValidator>
                                </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                    <asp:Label runat="server" ID="lblExternalId" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                        CssClass="CellTextBoxR">
                                        <asp:TextBox ID="txtExternalId" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("ExternalId") %>'
                                            runat="server">
                                        </asp:TextBox></asp:TableCell></asp:TableRow>
                        <asp:TableRow ID="AddressRow">
                            <asp:TableCell CssClass="CellLabelLTW">
                                <asp:Label runat="server" ID="lblEmail" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxL">
                                    <asp:TextBox ID="txtEmail" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("Email") %>'
                                        runat="server">
                                    </asp:TextBox><br />
                                    <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ErrorMessage="*"
                                        ControlToValidate="txtEmail" CssClass="validator"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="revEmail" ControlToValidate="txtEmail"
                                        ValidationExpression="^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$" CssClass="validator"
                                        runat="server" Display="Dynamic"></asp:RegularExpressionValidator>
                                    <asp:CustomValidator ValidationGroup="Information" ID="cvEmail" ControlToValidate="txtEmail" CssClass="validator"
                                        runat="server" OnServerValidate="cvEmail_ServerValidate" Display="Dynamic"></asp:CustomValidator>
                                </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                    <asp:Label runat="server" ID="lblAddress" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                        CssClass="CellTextBoxR">
                                        <asp:TextBox ID="txtAddress" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("Address") %>'
                                            runat="server"></asp:TextBox></asp:TableCell></asp:TableRow>
                        <asp:TableRow ID="PhoneRow" runat="server">
                            <asp:TableCell CssClass="CellLabelLTW">
                                <asp:Label runat="server" ID="lblPhone" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxL">
                                    <telerik:RadMaskedTextBox ID="txtPhone" runat="server" MaxLength="250" CssClass="TextBoxPopUp"
                                        Text='<%# Bind("Phone") %>' Mask="(###) ###-####-####" DisplayMask="(###) ###-####-####">
                                    </telerik:RadMaskedTextBox>
                                </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                    <asp:Label runat="server" ID="lblCellPhone" CssClass="fontLabel" /></asp:TableCell>
                                    <asp:TableCell
                                        CssClass="CellTextBoxR">
                                        <telerik:RadMaskedTextBox ID="txtCellPhone" runat="server" MaxLength="250" CssClass="TextBoxPopUp"
                                            Text='<%# Bind("CellPhone") %>' Mask="(###) ###-####-####" DisplayMask="(###) ###-####-####">
                                        </telerik:RadMaskedTextBox>
                                    </asp:TableCell></asp:TableRow>

                            <asp:TableRow ID="TableRow1" runat="server">
                            <asp:TableCell CssClass="CellLabelLTW">
                                <asp:Label runat="server" ID="lblIsSuper" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxL">
                                    <asp:CheckBox ID="chkIsSuper" runat="server" />
                                </asp:TableCell>
                                 
                                  <asp:TableCell  CssClass="CellLabelRTW">
                                     <asp:Label runat="server" ID="lblSecurityLevel" CssClass="fontLabel" /></asp:TableCell>
                                    <asp:TableCell
                                        CssClass="CellTextBoxR">
                                       <telerik:RadComboBox  ID="cbSecurityLevel" Skin="Vista" runat="server" CausesValidation="true" ></telerik:RadComboBox>
                                    
                                        <asp:RequiredFieldValidator ControlToValidate="cbSecurityLevel" runat="server" ID="Securitycv" CssClass="validator"  Display="Dynamic"  ErrorMessage="*"></asp:RequiredFieldValidator>
                                    </asp:TableCell></asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell ColumnSpan="4">
                                <asp:Label ID="lblValidationText" CssClass="validator" runat="server" Font-Italic="true"></asp:Label>
                            </asp:TableCell></asp:TableRow>
                    </asp:Table>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageViewUser" runat="server"  Width="100%">
                 <div class="TabTitle">
                    <asp:Label ID="lblTitleTab1" runat="server"></asp:Label>
                </div>
                    <asp:Table ID="Table2" CssClass="EditFormTable" runat="server">
                        <asp:TableRow ID="MandatorySearchRow" runat="server">
                            <asp:TableCell Width="100%">
                                <div style="width: 98%">
                                    <div style="width: 100%; border-color: #B8E3FB; border-style: solid; border-width: 1px;">
                                        <center>
                                            <asp:Label ID="lblDefineMandatorySearch" CssClass="titleMandatory" runat="server"></asp:Label></center>
                                        <telerik:RadFilter ID="radMandatorySearch" runat="server" ShowApplyButton="true"
                                            ExpressionPreviewPosition="Bottom">
                                            <ClientSettings> <ClientEvents  OnFilterCreated="filterCreated"/></ClientSettings>
                                            
                                        </telerik:RadFilter>
                                    </div>
                                    <br />
                                    <div style="width: 100%;">
                                        <center>
                                            <asp:Label ID="lblDefinedMandatorySearch" CssClass="titleMandatory" runat="server"></asp:Label>
                                            <asp:ImageButton ImageUrl="~/UI/Images/cross.png" ID="btnRemove"  runat="server"
                                                OnClick="btnRemove_Click" /></center>
                                        <br />
                                        <center>
                                            <asp:Label ID="txtMandatorySearch" CssClass="fontLabel"  
                                                runat="server"></asp:Label></center>
                                    </div>
                                </div>
                            </asp:TableCell></asp:TableRow>
                    </asp:Table>
                </telerik:RadPageView>
            </telerik:RadMultiPage></div>
        <div class="footerSave" runat="server">
            <asp:Table runat="server" Width="100%" HorizontalAlign="Right">
                <asp:TableRow>
                    <asp:TableCell HorizontalAlign="center">
                        <telerik:RadButton ID="btnSave" runat="server" Skin="Vista" Width="100px" OnClick="btnSave_OnClick" />
                        <telerik:RadButton ID="btnCancel" runat="server" Skin="Vista" Width="100px" CausesValidation="False"
                            ToolTip="Cancel" OnClientClicked="CancelEdit" />
                             <telerik:RadButton ID="btnDelete" runat="server" Skin="Vista" Width="100px" CausesValidation="False"
                            ToolTip="Remove current User"   OnClick="btnDelete_OnClick" />
                      
                    </asp:TableCell></asp:TableRow>
            </asp:Table>
        </div>
        
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
                <Windows>
                    <telerik:RadWindow ID="UserListDialog" runat="server" Height="600px" Width="900px"
                        Left="15%" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="True"
                        Behaviors="Close" />
                </Windows>
            </telerik:RadWindowManager>
        </form>
    </body>
    </html>



    And .cs:
    using System;
    using System.Globalization;
    using System.Resources;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
    using WebSearch.Components;
    using WebSearch.SecurityModel;

    namespace WebSearch.UI.Admin
    {
        public partial class UserForm : Page
        {

            #region Properties&Variables

            private smOrganization _organization = new smOrganization();
            private string _culture;
            private ResourceManager _resources;
         

            #endregion

            #region Events
            
            protected void Page_Load(object sender, EventArgs e)
            {

                if (Page.IsPostBack) return;

                LoadSettings();
                FillComboBox();

                if (Request.QueryString["ID"] != null)
                {
                    Session["ID"] = Request.QueryString["ID"];
                    LoadUser();
                }
                else
                {
                    btnDelete.Visible = false;
                    Page.Title = _resources.GetString("AddFull", new CultureInfo(_culture));
                }
            }

            protected void btnDelete_OnClick(object sender, EventArgs e)
            {
                try
                {
                    if (_organization.IsSuperUser(Convert.ToInt16(GetId())))
                    {
                        if (_organization.IsUniqueSuper())
                        {
                            RadWindowManager1.RadAlert(_resources.GetString("ErrorDelete", new CultureInfo(_culture)), 330, 100, _resources.GetString("ErrorTitleDelete", new CultureInfo(_culture)), "");

                        }
                    }

                    else
                    {
                        RadWindowManager1.RadConfirm(_resources.GetString("confirmText", new CultureInfo(_culture)), "confirmCallBackFn", 330, 100, null, _resources.GetString("confirmTitle", new CultureInfo(_culture)));
                    }

                   
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.ToString());
                }
               
                
            }


            protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
            {
                if (e.Argument == "Remove") //delete users
                {
                    //    _organization.RemoveUser(Convert.ToInt16(Session["ID"]));

                    ClientScript.RegisterStartupScript(Page.GetType(), "mykey2", "CloseAndRebind();", true);
                }

              
            }



            protected void Page_Init(object sender, EventArgs e)
            {
                GetInfo();
               
                radMandatorySearch.Culture = new CultureInfo(_culture);
                radMandatorySearch.PreRender += NewFilterPreRender;
                radMandatorySearch.ApplyExpressions += NewFilterApplyExpressions;

                CommonFunctions.CreateFieldSearch(radMandatorySearch, _culture, SecurityModel.smDocumentType.DocType.Email);
                radMandatorySearch.ApplyButtonText = _resources.GetString("ApplyButton", new CultureInfo(_culture));
            }

            protected void btnRemove_Click(object sender, ImageClickEventArgs e)
            {
                txtMandatorySearch.Text = null;
            }
            
            protected void cvLoginId_ServerValidate(object sender, ServerValidateEventArgs e)
            {
                e.IsValid = !_organization.ExistLogin(e.Value.ToString(), GetId());
            }

           

            protected void cvEmail_ServerValidate(object sender, ServerValidateEventArgs e)
            {
               e.IsValid = !_organization.ExistEmail(e.Value.ToString(), GetId());
            }
            
            protected void btnSave_OnClick(object sender, EventArgs e)
            {
                Page.Validate("Information");
                if (!Page.IsValid)
                {
                    RadTabStrip1.Tabs.FindTabByValue("Information").Selected = true;
                    RadPageViewInformation.Selected = true;
                    return;
                }


                _organization.User = new smUser
                                         {
                                             FirstName = txtFirstName.Text,
                                             MiddleName = txtMiddleName.Text,
                                             LastName = txtLastName.Text,
                                             Email = txtEmail.Text,
                                             Loginid = txtLoginId.Text,
                                             Phone = txtPhone.Text,
                                             CellPhone = txtCellPhone.Text,
                                             Address = txtAddress.Text,
                                             ExternalId = txtExternalId.Text,
                                             MandatorySearch = txtMandatorySearch.Text,
                                             IsSuper = chkIsSuper.Checked,
                                             SecurityLevelId = Convert.ToInt16(cbSecurityLevel.SelectedValue)
                                         };
                
                try
                {
                    _organization.Quick = true;

                    if (Session["ID"] == null)
                    {
                        _organization.CreateUser();
                       
                    }
                    else
                    {
                        _organization.User.Id = Convert.ToInt32(Session["ID"]);
                        _organization.UpdateUser();
                        Session["ID"] = null;
                    }
                }
                catch(Exception ex)
                {
                    throw  new Exception(ex.ToString());
                }
                finally
                {
                    ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);
                }
             }
         
            #endregion

            #region Methods

            private int GetId()
            {
                if (Request.QueryString["ID"] != null)
                {
                    Session["ID"] = Request.QueryString["ID"];
                }
                return Convert.ToInt16(Session["ID"] ?? 0);
            }

            private void FillComboBox()
            {
                cbSecurityLevel.DataSource = _organization.GetSecurityLevels();
                cbSecurityLevel.DataTextField = "Name";
                cbSecurityLevel.DataValueField = "Id";
                cbSecurityLevel.DataBind();
            }

            private void LoadUser()
            {
                _organization = new smOrganization();

                smUser currentUser = _organization.GetUser(GetId());

                txtPhone.Text = currentUser.Phone;
                txtMiddleName.Text = currentUser.MiddleName;
                txtMandatorySearch.Text = currentUser.MandatorySearch;
                txtLoginId.Text = currentUser.Loginid;
                txtLastName.Text = currentUser.LastName;
                txtFirstName.Text = currentUser.FirstName;
                txtExternalId.Text = currentUser.ExternalId;
                txtEmail.Text = currentUser.Email;
                txtCellPhone.Text = currentUser.CellPhone;
                txtAddress.Text = currentUser.Address;
                chkIsSuper.Checked = currentUser.IsSuper;
                cbSecurityLevel.SelectedValue = currentUser.SecurityLevelId.ToString();
                
                Page.Title = _resources.GetString("EditFull", new CultureInfo(_culture)) + " " +currentUser.FirstName + "," + currentUser.LastName;

              
            }

            private void GetInfo()
            {
                _culture = App.CurrentCulture();
                _resources = _resources = App.GetAdminResources("UserManagement");
            }

            private void LoadSettings()
            {
                RadTabStrip1.Tabs.FindTabByValue("Information").Text = _resources.GetString("Information", new CultureInfo(_culture));
                RadTabStrip1.Tabs.FindTabByValue("Mandatory").Text = _resources.GetString("Mandatory", new CultureInfo(_culture));
        
                lblFirstName.Text = _resources.GetString(lblFirstName.ID, new CultureInfo(_culture));
                lblMiddleName.Text = _resources.GetString(lblMiddleName.ID, new CultureInfo(_culture));
                lblLastName.Text = _resources.GetString(lblLastName.ID, new CultureInfo(_culture));
                lblCellPhone.Text = _resources.GetString(lblCellPhone.ID, new CultureInfo(_culture));
                lblPhone.Text = _resources.GetString(lblPhone.ID, new CultureInfo(_culture));
                lblAddress.Text = _resources.GetString(lblAddress.ID, new CultureInfo(_culture));
                lblEmail.Text = _resources.GetString(lblEmail.ID, new CultureInfo(_culture));
                lblExternalId.Text = _resources.GetString(lblExternalId.ID, new CultureInfo(_culture));
                lblLoginId.Text = _resources.GetString(lblLoginId.ID, new CultureInfo(_culture));
                lblIsSuper.Text = _resources.GetString(lblIsSuper.ID, new CultureInfo(_culture));

                lblValidationText.Text = _resources.GetString(lblValidationText.ID, new CultureInfo(_culture));
                cvLoginId.ErrorMessage = _resources.GetString(cvLoginId.ID, new CultureInfo(_culture));
                revEmail.ErrorMessage = _resources.GetString(revEmail.ID, new CultureInfo(_culture));
                cvEmail.ErrorMessage = _resources.GetString(cvEmail.ID, new CultureInfo(_culture));
                lblDefineMandatorySearch.Text = _resources.GetString(lblDefineMandatorySearch.ID, new CultureInfo(_culture));
                lblDefinedMandatorySearch.Text = _resources.GetString(lblDefinedMandatorySearch.ID, new CultureInfo(_culture));

                btnSave.Text = _resources.GetString(btnSave.ID, new CultureInfo(_culture));
                btnCancel.Text = _resources.GetString(btnCancel.ID, new CultureInfo(_culture));

                lblTitleTab2.Text = _resources.GetString(lblTitleTab2.ID, new CultureInfo(_culture));
                lblTitleTab1.Text = _resources.GetString(lblTitleTab1.ID, new CultureInfo(_culture));

                chkIsSuper.Visible = App.CurrentUserIsSuper();
                cbSecurityLevel.EmptyMessage = _resources.GetString(cbSecurityLevel.ID, new CultureInfo(_culture));
                lblSecurityLevel.Text = _resources.GetString(lblSecurityLevel.ID, new CultureInfo(_culture));
                //cvSecurityLevel.ErrorMessage = _resources.GetString(cvSecurityLevel.ID, new CultureInfo(_culture));
                btnDelete.Text = _resources.GetString(btnDelete.ID, new CultureInfo(_culture));
            }

            private void NewFilterApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e)
            {
                RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider();
                provider.ProcessGroup(e.ExpressionRoot);

                txtMandatorySearch.Text = txtMandatorySearch.Text + provider.Result;

                radMandatorySearch.RecreateControl();
            }

            protected void NewFilterPreRender(object sender, EventArgs e)
            {

                if (radMandatorySearch.RootGroupItem.Controls[0].Controls[2].Controls.Count > 0)
                {
                    radMandatorySearch.RootGroupItem.Controls[0].Controls[2].Controls[1].Visible = false; // remove group option    
                }
            }



            #endregion

           
        }
    }
  2. Answer
    Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 01 Dec 2011 Link to this post

    Hello Julieta,

    Change this line:

    ClientScript.RegisterStartupScript(Page.GetType(), "mykey2", "CloseAndRebind();", true);

    To this:

    RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("CloseAndRebind();");

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 02 Dec 2011 Link to this post

    Hi kevin this
     RadAjaxManager.GetCurrent(Page)
    is NUll :-(
  5. Answer
    Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 02 Dec 2011 Link to this post

    Hello Julieta,

    I thought it would work even though the RadAjaxManager is declared on the page. You can access the ResponseScripts using the name of your RadAjaxManager on your page. So \RadAjaxManager1.ResponseScripts.

    I hope that helps.
  6. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 02 Dec 2011 Link to this post

    I find the solution Kevin...
    I change this
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"  />
      <telerik:RadScriptManager ID="RadScriptManager2" runat="server"></telerik:RadScriptManager>
    by this


      <telerik:RadScriptManager ID="RadScriptManager2" runat="server"></telerik:RadScriptManager>
       
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"  />

    And works!

    Thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017