using window with notification

3 posts, 1 answers
  1. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 26 Sep 2013 Link to this post

    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">
                <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>
                            <telerik:RadTextBox runat="server" ID="emailAddress"></telerik:RadTextBox>
                            <telerik:RadButton runat="server" ID="ResetPasswordButton" Text="Submit" OnClick="ResetPassword_Submit"></telerik:RadButton>
        <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">
    if (Membership.GetUser(emailAddress.Text) == null)
       Notifier.ContentIcon = "warning";
       Notifier.Show("The system could not find a user with that email address.");

  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 27 Sep 2013 Link to this post

    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.

    Marin Bratanov
    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.
  3. DevCraft R3 2016 release webinar banner
  4. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 27 Sep 2013 Link to this post

    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.
Back to Top