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

Don´t hide message use of jQuery

1 Answer 60 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 18 Mar 2012, 11:01 PM
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 

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 22 Mar 2012, 08:17 AM
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.
Tags
Ajax
Asked by
Jan
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or