I am a beginner. I am trying to learn ajax tab control. I have a 3 tabs each one with a few text boxes and a submit button. The problem is when i double click on a button it takes me to source code(html) i want write code for button click even on a .cs file. How do i do that?
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<b>Tabs Demonstration</b> <br /><br />
<asp:TabContainer runat="server" ID="Tabs" Height="138px" ActiveTabIndex="0"
Width="402px">
<asp:TabPanel runat="server" ID="Panel1" HeaderText="Address">
<ContentTemplate>
<asp:UpdatePanel ID="updatePanel1" runat="server">
<ContentTemplate>
<table>
<tr><td class="style1">First Name:</td><td class="style1"><asp:TextBox ID="txtName" runat="server" /></td></tr>
<tr><td>Address:</td><td><asp:TextBox ID="txtAddress" runat="server" /></td></tr>
<tr><td>
<asp:Button ID="Button1" runat="server" Text="Submit" /></td></tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel runat="server" ID="Panel3" HeaderText="Email" >
<ContentTemplate>
Email: <asp:TextBox ID="txtEmail" runat="server" />
<asp:Button ID="Button2" runat="server" Text="Button" /></ContentTemplate>
</asp:TabPanel>
<asp:TabPanel runat="server" ID="Panel2" HeaderText="Login Details">
<ContentTemplate>
<table>
<tr> <td>User Name:</td><td><asp:TextBox ID="txtUser" runat="server" /></td></tr>
<tr> <td>Password:</td><td><asp:TextBox ID="txtPass" runat="server" /><asp:Button ID="Button3" runat="server"
Text="Button" /></td></tr>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</form>
You can do this manually to your button in
.aspxpage by adding OnClick=”Button1_Click”:then in your code-behind
.aspx.cs(pressF7while in.aspxin Visual Studio) write:or for
.aspx.vbNow when the button is clicked, the code in
Button1_Clickgets executed.