Don´t hide message use of jQuery

2 posts, 0 answers
  1. Jan
    Jan avatar
    8 posts
    Member since:
    Mar 2012

    Posted 18 Mar 2012 Link to this post

    Hi I have page where is usercontrol with message
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Message.ascx.cs" Inherits="Elearning.Usecases.UserControl.Message" %>
     
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
     
            setTimeout(function () {
                $("#<%=MessageContainer.ClientID %>").fadeOut("slow", function () {
                    $("#<%=MessageContainer.ClientID %>").remove();
                });
            }, 2000);
            $('.closeImage').click(function () {
                $(this).parent().hide();
            });
     
        });
    </script>
    <div Class="Message">
    <asp:Panel ID="MessageContainer"  runat="server">
        <asp:Image ID="CloseImage" CssClass="closeImage icon" Style="float: right;" runat="server" ImageUrl='<%# HermesControl.GetAppItemRelativeUrl(Elearning.ElearningCommon.Icons.Delete  ) %>' />
        <asp:Label ID="lblMessage" EnableViewState="false" runat="server" />
    </asp:Panel>
    </div>
    Main page 
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
            <telerik:AjaxSetting AjaxControlID="imgbtnShowMessagetnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="message1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="message1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="message1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <include:message ID="message1" runat="server" />
    <asp:Button runat="server" ID="btnShowMessage"/>

    And if a call show messages, then message show but don´t hide after two second.
    Please you know why?

    Thanks and sorry for my english 

  2. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 22 Mar 2012 Link to this post

    Hello Jan,

    Can you confirm if your code works fine when you do not use RadAjax but an asp:UpdatePanel? It seems like our controls are not related to the problem at hand, as on my side the same behavior is observed when I copy your script and remove the RadAjaxManager(Proxy).

    Kind regards,
    Tsvetina
    the Telerik team
    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 their blog feed now.
Back to Top