Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am currently working for the first time in ajax Tab container,i have 2 tabs, In first tab, i'm just getting user input and save it into Sql,and in second tab, displying some data in grid. My problem is in my first tab, when i click save button, it doesnt fires button_click event.where else all the other events like Gridview1_PageIndexChanging and DropDown1_SelectedIndexChanged works good.. any help??

my code:

<asp:ScriptManager ID="ScriptManager1"  runat="server" ></asp:ScriptManager>
<asp:TabContainer ID="TabContainer1"  CssClass="fancy fancy-green"   runat="server"  Height="357px" Width="950px" ActiveTabIndex="0" >
    <asp:TabPanel ID="Tab0" HeaderText="Add Inventory"  runat="server">
    <div id="Add1" class="divinventory5" runat="server">
    <h1 align="center" >Add Inventory</h1>
<table cellpadding="10">
<td><asp:Label ID="Label2" Text="Name Of Inventory:" runat="server"></asp:Label></td>
<td> <asp:TextBox ID="Inventory" CausesValidation="false"  CssClass="myInput" runat="server"/></td>
<td><asp:Label ID="Label3" Text="Identity(eg:Serial Number):" runat="server"></asp:Label></td>
<td> <asp:TextBox ID="txtidentity" CausesValidation="false" CssClass="myInput" runat="server"/></td>
<asp:Button ID="Button1" CausesValidation="false" Text="Add"  Width="150px"
          CssClass="loginareabuttons" runat="server" onclick="Button1_Click"  />
<asp:Button ID="Button2" CausesValidation="false"  Text="Cancel" Width="150px"
          CssClass="loginareabuttons" runat="server" onclick="Button2_Click"  />
    <asp:TabPanel ID="Tab1" HeaderText="Total Render Inventory"  runat="server">
    <div id="Div1" class="grd1" runat="server">
<asp:GridView ID="Gridview1" AllowPaging="true"  rowstyle-cssclass="rowHover"  PageSize="6"
        captionalign="Top"   AutoGenerateColumns="false"
        runat="server"  Width="950px" Height="370px"  DataKeyNames="I_id"
         HeaderStyle-BackColor="black" HeaderStyle-ForeColor="White"
        PagerSettings-Position="Bottom" PagerStyle-BackColor="Black"
        PagerStyle-ForeColor="White" onpageindexchanging="Gridview1_PageIndexChanging">
<asp:BoundField DataField="RenderName" ItemStyle-HorizontalAlign="Center" HeaderText="Name" ItemStyle-Width="100px" />
<asp:BoundField DataField="RenderInventory" ItemStyle-HorizontalAlign="Center" HeaderText="Render-Inventory" ItemStyle-Width="100px" />
<asp:BoundField DataField="Rendermodel" ItemStyle-HorizontalAlign="Center" HeaderText="Render-Model" ItemStyle-Width="100px"     />
<asp:BoundField DataField="RenderDate" ItemStyle-HorizontalAlign="Center" HeaderText="Date of Render"  ItemStyle-Width="100px" />
Updated 11-Jun-13 23:19pm
Sunasara Imdadhusen 12-Jun-13 9:52am    
Is there any error?
Ramkumar K 12-Jun-13 10:21am    
Yeah :( . when i click add button in tab 1,it doesn't fire its onclick event.
bluesathish 13-Jun-13 1:44am    
Set the AutoPostBack="true" in tab container property.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900