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

srcElement is null or not an object

1 Answer 75 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Das
Top achievements
Rank 1
Das asked on 07 Jan 2009, 08:39 AM
Hi,

I am using the following code to display the Ajax Loading image. When I do for the first time everything seems to be working. For the second time I am getting this error.

<script language="javascript" type="text/javascript">
        var currentLoadingPanel = null;
        var currentUpdatedControl = null;

        function RequestStart(sender, args)
        {
            alert('hi');
            LoadingPanel1='<%=image.ClientID %>'
            currentLoadingPanel = document.getElementById(LoadingPanel1);
            currentLoadingPanel.style.display="block";
        }

        function ResponseEnd()
        {
            //hide the loading panel and clean up the global variables
            if (currentLoadingPanel != null)
                currentLoadingPanel.style.display="none";
            currentUpdatedControl = null;
            currentLoadingPanel = null;
        }
</script>

<rad:RadAjaxManager id="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <rad:AjaxSetting AjaxControlID="btnSearch">
            <UpdatedControls>
                <rad:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="LoadingPanel1"></rad:AjaxUpdatedControl>
            </UpdatedControls>
        </rad:AjaxSetting>
    </AjaxSettings>
    <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</rad:RadAjaxManager>
<rad:AjaxLoadingPanel id="LoadingPanel1" Runat="server">
    <asp:Image id="Image1" runat="server" ImageUrl="~/Images/loading4.gif" BorderWidth="0px" AlternateText="Loading"></asp:Image>
</rad:AjaxLoadingPanel>
<div id="image" runat="server" style="display:none">
    <asp:Image id="Image2" runat="server" ImageUrl="~/RadControls/Ajax/Skins/Default/loading4.gif" BorderWidth="0px" AlternateText="Loading"></asp:Image>
</div> 
<asp:Panel ID="Panel1" runat="server" width="100%">
<!--Dropdown list, textbox here -->
<asp:Button runat="server" Text="Search" ID="btnSearch" OnClick="btnSearch_Click" />
<!-- My RADGrid here -->
</asp:Panel>





1 Answer, 1 is accepted

Sort by
0
Das
Top achievements
Rank 1
answered on 08 Jan 2009, 03:15 AM
Hi, please someone provide me with some solution. I have already wasted my entire day struggling in this. Thanks.
Tags
Ajax
Asked by
Das
Top achievements
Rank 1
Answers by
Das
Top achievements
Rank 1
Share this question
or