Update a AjaxPanel from new window postback

4 posts, 0 answers
  1. Linh Hoang
    Linh Hoang avatar
    22 posts
    Member since:
    Dec 2009

    Posted 21 Jun 2015 Link to this post

    Hi all,

    I have a AjaxPanel consisting of a radgrid and a button; when I clicked the button, a new RadWindow was opened; on the new opened window, there are a check list and a submit button. Now I want to select items from check list, click submit button to update the AjaxPanel. How could I do this?

    So much appriciated for any suggestion.

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 24 Jun 2015 Link to this post

    Hello Linh,

    In order to implement the behavior you are looking for you should consider using RadAjaxManager. It was built to handle more complex scenarios.

    The following code snippets outline the approach with simple Label and Button controls. You can follow the same approach in your scenario.

    Markup:

    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Button2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
     
    <asp:Panel runat="server" ID="Panel1">
        <asp:Label ID="Label1" runat="server" />
     
        <asp:Button ID="Button1" Text="Open Window" runat="server" OnClientClick="clientClick(); return false;" />
     
    </asp:Panel>
    <telerik:RadWindow runat="server" ID="RadWindow1">
        <ContentTemplate>
            some content
            <br />
     
            <asp:Button ID="Button2" Text="Update Panel" runat="server" OnClick="Button2_Click" OnClientClick="hideWindow();" />
     
        </ContentTemplate>
     
    </telerik:RadWindow>


    JavaScript:

    function clientClick(sender, args) {
        $find("<%= RadWindow1.ClientID %>").show();
    }
     
    function hideWindow(sender, args) {
        $find("<%= RadWindow1.ClientID %>").hide();
    }


    Code-behind:

    protected void Button2_Click(object sender, EventArgs e)
    {
        // add server-side logic here
     
        Label1.Text = DateTime.Now.ToString();
    }


    I hope this helps.

    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Linh Hoang
    Linh Hoang avatar
    22 posts
    Member since:
    Dec 2009

    Posted 24 Jun 2015 in reply to Viktor Tachev Link to this post

     Hi Viktor

    This definitely helps. Thank you very much for your code snippets!

  5. Linh Hoang
    Linh Hoang avatar
    22 posts
    Member since:
    Dec 2009

    Posted 29 Jun 2015 in reply to Viktor Tachev Link to this post

    Hi Viktor,

    This is exactly what I need, thank you so much.

Back to Top