Click here to Skip to main content
11,922,641 members (57,451 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax

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" />
Posted 12-Jun-13 0:17am
Edited 12-Jun-13 0:19am
Sunasara Imdadhusen 12-Jun-13 9:52am
Is there any error?
Ram1419 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

Advertise | Privacy | Mobile
Web03 | 2.8.151125.1 | Last Updated 12 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100