Member
255 Points
1077 Posts
Mar 11, 2013 03:20 PM|love4asp.net|LINK
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Panel1.Visible = false; }
protected void DisplayData(object sender, EventArgs e) { //form1.Controls.Add(Panel1); Panel1.Visible = true;
2nd code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <strong><span style="font-size: 14pt; color: #0000ff">Simple Application Form In ASP.Net</span></strong><br /> <br /> <br /> <br /> <table> <tr> <td style="width: 123px"> First Name</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="fname" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Last Name</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="lname" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Date of Birth</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="dob" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Gender</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="gender" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Father's Name</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="fathername" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Contact Number</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="contact" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Address</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="address" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px; height: 21px"> </td> <td style="width: 63px; height: 21px"> </td> <td style="width: 193px; height: 21px"> <asp:Label ID="conform" runat="server" Text="Submitted, thank you !" Visible="False" Width="152px"></asp:Label></td> </tr> <tr> <td style="width: 123px"> </td> <td style="width: 63px; text-align: center"> </td> <td style="width: 193px"> <asp:Button ID="submit" runat="server" Text="Submit" /></td> <td style="width: 193px"> <asp:Button ID="Button1" runat="server" Text="Displaycontactinfo" OnClick="DisplayData"/></td> </tr> <br /> <br /> <br /> <table style="width: 225px" > <asp:Panel ID="Panel1" runat="server" GroupingText="Panel Control Test"> <strong><span style="font-size: 14pt; color: #0000ff">Contact Information Form</span></strong> <tr> <td style="width: 200px"> First Name</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Last Name</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Date of Birth</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Gender</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Father's Name</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Contact Number</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px"> Address</td> <td style="width: 63px"> :</td> <td style="width: 193px"> <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 123px; height: 21px"> </td> <td style="width: 63px; height: 21px"> </td> <td style="width: 193px; height: 21px"></td> </tr> <tr> <td style="width: 123px"> </td> <td style="width: 63px; text-align: center"> </td> <td style="width: 193px"> <asp:Button ID="Button2" runat="server" Text="Submit" /></td> </tr> </asp:Panel> </table> </form> </body> </html>
need help in displaying 2nd form right side of the page. how to do it. kindly share your ideas.
} }
Member
255 Points
1077 Posts
Re: diaplay 2nd form on clicking displaybutton.
Mar 11, 2013 03:20 PM|love4asp.net|LINK
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Panel1.Visible = false;
}
protected void DisplayData(object sender, EventArgs e)
{
//form1.Controls.Add(Panel1);
Panel1.Visible = true;
2nd code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<strong><span style="font-size: 14pt; color: #0000ff">Simple Application Form In ASP.Net</span></strong><br />
<br />
<br />
<br />
<table>
<tr>
<td style="width: 123px">
First Name</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="fname" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Last Name</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="lname" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Date of Birth</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="dob" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Gender</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="gender" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Father's Name</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="fathername" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Contact Number</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="contact" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Address</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="address" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px; height: 21px">
</td>
<td style="width: 63px; height: 21px">
</td>
<td style="width: 193px; height: 21px">
<asp:Label ID="conform" runat="server" Text="Submitted, thank you !" Visible="False"
Width="152px"></asp:Label></td>
</tr>
<tr>
<td style="width: 123px">
</td>
<td style="width: 63px; text-align: center">
</td>
<td style="width: 193px">
<asp:Button ID="submit" runat="server" Text="Submit" /></td>
<td style="width: 193px">
<asp:Button ID="Button1" runat="server" Text="Displaycontactinfo" OnClick="DisplayData"/></td>
</tr>
<br />
<br />
<br />
<table style="width: 225px" >
<asp:Panel ID="Panel1" runat="server" GroupingText="Panel Control Test">
<strong><span style="font-size: 14pt; color: #0000ff">Contact Information Form</span></strong>
<tr>
<td style="width: 200px">
First Name</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Last Name</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Date of Birth</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Gender</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Father's Name</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Contact Number</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px">
Address</td>
<td style="width: 63px">
:</td>
<td style="width: 193px">
<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 123px; height: 21px">
</td>
<td style="width: 63px; height: 21px">
</td>
<td style="width: 193px; height: 21px"></td>
</tr>
<tr>
<td style="width: 123px">
</td>
<td style="width: 63px; text-align: center">
</td>
<td style="width: 193px">
<asp:Button ID="Button2" runat="server" Text="Submit" /></td>
</tr>
</asp:Panel>
</table>
</form>
</body>
</html>
need help in displaying 2nd form right side of the page. how to do it. kindly share your ideas.
}
}