how to show loading image when tab content is loading?
<p>I have a tabcontainer with three panel, inside that I have gridview. When I user click on the tab the gridview is loaded. I want untill the gridview is loading, an img gif should be shown, and should got hide after the grid loads completely.
For that I had written code as:</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="example.aspx.cs"
    Inherits="example" %&gt;

&lt;%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %&gt;
&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head id="Head1" runat="server"&gt;

    &lt;script type="text/javascript"&gt;

        $(function() {



        $("#mytab").mytab({
                ajaxOptions: {
                    type: 'POST',
                    data: postData,
                    beforeSend: function() {
                        $('#loader').show();
                    },
                    complete: function() {
                        $("#loader").hide();
                    }
                }
            });
        });

&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form2" runat="server"&gt;
    &lt;iframe id="iFrame2" runat="server" height="2px" width="2px"&gt;&lt;/iframe&gt;
        &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&gt;
    &lt;ContentTemplate&gt;
    &lt;div&gt;
        &lt;asp:ScriptManager ID="ScriptManager2" runat="server" EnablePartialRendering="true"&gt;
        &lt;/asp:ScriptManager&gt;


    &lt;/div&gt;
  &lt;asp:Panel ID="loader" runat="server" Wrap="true" CssClass="body"  &gt;
                    &lt;table cellpadding="5" cellspacing="5" style="width:322px; height:245px; border:1"&gt;
                        &lt;tr&gt;
                            &lt;td style="width:322px; height:245px; border:1"&gt;
                                &lt;asp:Image ID="Image1" Width="322px" Height="245px" BorderWidth="0" runat="server" ImageUrl="Images/loading.gif" /&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/table&gt;
                &lt;/asp:Panel&gt;

       &lt;cc1:TabContainer ID="mytab" runat="server"  Width="100%"
                                Visible="true" AutoPostBack="true" &gt;
                                &lt;cc1:TabPanel runat="server"   HeaderText="application" ID="TabPanel1" 
                                    &gt;
                                    &lt;ContentTemplate&gt;
                                    &lt;asp:Panel ID="Panel1" runat="server"&gt;
                                        &lt;table class="outline-tabs"&gt;
                                            &lt;tr class="pagination-row"&gt;

                                            &lt;/tr&gt;
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    &lt;asp:UpdatePanel ID="UpdatePanel3" runat="server"&gt;
                                                        &lt;ContentTemplate&gt;
                                                            &lt;asp:GridView ID="GridView1" runat="server" CssClass="tblGrid" AllowSorting="True"&gt;

                                                    &lt;/asp:GridView&gt;
                                                        &lt;/ContentTemplate&gt;
                                                    &lt;/asp:UpdatePanel&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;

                                        &lt;/table&gt;
                                    &lt;/asp:Panel&gt;

                                    &lt;/ContentTemplate&gt;
                                &lt;/cc1:TabPanel&gt;



            &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>But when I run the application I get a error as:</p>

<p><code>Microsoft JScript runtime error: Object expected</code></p>

<p>What is wrong with the above code, any file is missing, since I'm using jquery.</p>
