Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax
Hi..,
 
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">
    <ContentTemplate>
    <div id="Add1" class="divinventory5" runat="server">
    <h1 align="center" >Add Inventory</h1>
<table cellpadding="10">
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<td>
<asp:Button ID="Button1" CausesValidation="false" Text="Add"  Width="150px"
          CssClass="loginareabuttons" runat="server" onclick="Button1_Click"  />
</td>
<td>
<asp:Button ID="Button2" CausesValidation="false"  Text="Cancel" Width="150px"
          CssClass="loginareabuttons" runat="server" onclick="Button2_Click"  />
</td>
</tr>
</table>
</div>
    </ContentTemplate>
    </asp:TabPanel>
    <asp:TabPanel ID="Tab1" HeaderText="Total Render Inventory"  runat="server">
     <ContentTemplate>
    <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">
<Columns>
<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" />
</Columns>
</asp:GridView></div>
    </ContentTemplate>
    </asp:TabPanel>
Posted 12-Jun-13 0:17am
Edited 12-Jun-13 0:19am
v2
Comments
Sunasara Imdadhusen at 12-Jun-13 9:52am
   
Is there any error?
Ram1419 at 12-Jun-13 10:21am
   
Yeah :( . when i click add button in tab 1,it doesn't fire its onclick event.
bluesathish at 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
0 OriginalGriff 295
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 174
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 12 Jun 2013
Copyright © CodeProject, 1999-2014
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