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

Update a AjaxPanel from new window postback

3 Answers 67 Views
AjaxPanel
This is a migrated thread and some comments may be shown as answers.
Linh Hoang
Top achievements
Rank 1
Linh Hoang asked on 22 Jun 2015, 01:04 AM

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.

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 24 Jun 2015, 12:34 PM
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
0
Linh Hoang
Top achievements
Rank 1
answered on 24 Jun 2015, 11:19 PM

 Hi Viktor

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

0
Linh Hoang
Top achievements
Rank 1
answered on 29 Jun 2015, 10:58 PM

Hi Viktor,

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

Tags
AjaxPanel
Asked by
Linh Hoang
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Linh Hoang
Top achievements
Rank 1
Share this question
or