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

Cannot make RadWindow work with Ajax panel.

3 Answers 90 Views
Window
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 24 May 2011, 08:40 AM
Hello
I have custom control (ascx) for change password:
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" %>
<telerik:RadAjaxPanel ID="pnlChangePassword" runat="server" DefaultButton="btnChange" LoadingPanelID="ralMain">
    <div class="box" style="width: 445px;">
        <fieldset>
            <asp:Label ID="lblOldPassword" AssociatedControlID="txbOldPassword" runat="server" Text="<%$ Resources: Common, OldPassword_label %>" />
            <asp:TextBox ID="txbOldPassword" TextMode="Password" runat="server" MaxLength="100" />       
        </fieldset>
        <fieldset>
            <asp:Label ID="lblPassword" AssociatedControlID="txbPassword" runat="server" Text="<%$ Resources: Common, NewPassword_label %>" />
            <asp:TextBox ID="txbPassword" TextMode="Password" runat="server" MaxLength="100" />        
        </fieldset>
        <fieldset>
            <asp:Label ID="lblConfirmPassword" AssociatedControlID="txbConfirmPassword" runat="server" Text="<%$ Resources: Common, NewPasswordConfirm_label %>" />
            <asp:TextBox ID="txbConfirmPassword" TextMode="Password" runat="server" MaxLength="100" />         
        </fieldset>
    </div>
    <div>
        <asp:Button ID="btnChange" runat="server" CssClass="button" Text="<%$ Resources: Common, ChangePassword_button %>" OnClick="HandlerButtonOnClick" />
    </div>
</telerik:RadAjaxPanel>
Which is loaded on other custom control (ascx) with folowing code

<script type="text/javascript">
    //<![CDATA[
    function CloseWin() {
        $find('<%= changePasswordWindow.ClientID %>').close();
    }
    function OpenWin() {
        $find('<%= changePasswordWindow.ClientID %>').show();
    }
    //]]>
</script>
<telerik:RadWindow ID="changePasswordWindow" Title="<%$ Resources: Common, ChangeYourPassword_title %>" runat="server" Modal="true" Behavior="Close" EnableShadow="true" Width="530px"
    Height="300px" VisibleStatusbar="false">
    <ContentTemplate>
        <div style="margin: 10px;">
            <ref:ChangePassword ID="changePassword" runat="server" />
        </div>
        <asp:LinkButton ID="btnBack" runat="server" Text="<%$ Resources: Common, Close_label %>" CausesValidation="false" OnClientClick="CloseWin();return false;" />
    </ContentTemplate>
</telerik:RadWindow>
this windows is opened with button:
<asp:Button ID="btnChange" runat="server" CssClass="button" Text="<%$ Resources: Common, ChangePassword_button %>" CausesValidation="false" OnClientClick="OpenWin();return false;" />

Now when I press change button on window, ajax panel is not showing. Wait cursor is not loading. How can I fix it.
Marcin

P.S.
If I put validators inside this change password control, they are fired also if window is not shown. And vice versa. If window is shown it firering also validators on parent control. Is it any way to prevent that?

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 24 May 2011, 03:49 PM

Hello Marcin,

I do not see a RadAjaxLoadingPanel control in your user control markup and this is the most likely reason you do not see it - it simply does not exist. I added a loading panel in the user control and forced a 5 second wait on the server after the button is clicked so that it is displayed long enough (thus simulating the server logic taking time). You can find my test page attached and here is a video from my experiment: http://screencast.com/t/0NFsB7GayZS6.

As for the validators - this is the expected behavior, since you are using the RadWindow with its ContentTemplate. In that case the controls put inside the RadWindow are actually a part of the parent page and not an external one, which means that all validators are in effect for all fields.

What I would suggest is to add a ValidationGroup to separate the controls logically - for example one group for the controls and validators inside the RadWindow and another for the ones directly in the main page.



Regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Marcin
Top achievements
Rank 1
Veteran
answered on 24 May 2011, 03:58 PM
Hi, thank you for your help. I will look at this. I'm having RadAjaxLoadingPanel on MasterPage, with id ralMain. It is working with other my controls, grid panels etx. I'm just having issue with this one I will look to this example.
0
Marcin
Top achievements
Rank 1
Veteran
answered on 25 May 2011, 09:02 AM
Ha... silly bug. Validator on bottom page, wouldn't allow to process button click. It weren't visible. After adding validation group it started working. Thank you for your help.
Tags
Window
Asked by
Marcin
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Marcin
Top achievements
Rank 1
Veteran
Share this question
or