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

using window with notification

2 Answers 102 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 26 Sep 2013, 06:52 PM
I have a button defined inside a RadWindow content template that I want to run server code in ajax. The button is inside a RadAjaxPanel. when the server code is run, it could trigger a RadNotification, which is also on the page inside its own RadAjaxPanel.

It all seems to work sort of the first time it's run. The button is clicked and the notification is displayed if necessary. Then the user triggers the window again. I like that the textbox retains the previous value. But when the user clicks the button again, it performs a full page postback, instead of an ajax postback. There is nothing on the page that needs to refresh. Also, how do I keep the window open if the code is going to trigger a notification? Here is the code I'm using:
<telerik:RadWindow runat="server" ID="ForgotPasswordWindow" Modal="True" OpenerElementID="LinkButtonForgotPassword" Behaviors="Close" Title="Reset Password"
        Height="180px" VisibleStatusbar="False" Width="350px">
        <ContentTemplate>
            <telerik:RadAjaxPanel runat="server">
                <div style="margin: 10px;">
                    <p>If you already have an account and have forgotten your password, please enter the
                        email address for your account in the box provided below. A new password will be
                        emailed to this address.</p>
                    <div>
                        <telerik:RadTextBox runat="server" ID="emailAddress"></telerik:RadTextBox>
                        <telerik:RadButton runat="server" ID="ResetPasswordButton" Text="Submit" OnClick="ResetPassword_Submit"></telerik:RadButton>
                    </div>
                </div>
            </telerik:RadAjaxPanel>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadNotification runat="server" ID="Notifier" TitleIcon="none" ContentIcon="ok" KeepOnMouseOver="False"
            Animation="Fade" Position="Center" AutoCloseDelay="2000" ShowCloseButton="False" Height="90" Width="330"
            VisibleTitlebar="False" Skin="Silk">
        </telerik:RadNotification>
    </telerik:RadAjaxPanel>
if (Membership.GetUser(emailAddress.Text) == null)
{
   Notifier.ContentIcon = "warning";
   Notifier.Show("The system could not find a user with that email address.");
}
else
   ......


2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 27 Sep 2013, 09:48 AM
Hello Rayne,

This should work, and my test seems to confirm this. You can find attached my test page and a short flash video from my experiment.

Here are some points of interest:
- the RadAjaxPanel around the notification is not needed and you should remove it. It will not be updated on the button click so you cannot change server properties of the notification
- make sure there are no JavaScript errors on the page as they can break AJAX
- make sure there are no nested update panels (e.g. an AJAX setting from a RadAjaxManager that targets the RadWindow contents)

I would advise that you compare my test setup with yours and try to isolate the difference that causes the issue on your end.

Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Rayne
Top achievements
Rank 1
answered on 27 Sep 2013, 01:21 PM
Thank you. I'm not sure what made the difference but I changed my page to match your sample and it is working the way I want it to now.
Tags
Window
Asked by
Rayne
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Rayne
Top achievements
Rank 1
Share this question
or