<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</div>
</form>
</body>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
DataTable DT = new DataTable();
DT.Columns.Add("CODE");
if (TextBox1.Text != "")
{
DT.Rows.Add(TextBox1.Text);
}
if (TextBox2.Text != "")
{
DT.Rows.Add(TextBox2.Text);
}
if (TextBox3.Text != "")
{
DT.Rows.Add(TextBox3.Text);
}
int j = DT.Rows.Count;
if (j > 0)
{
for (int i = 0; i < j; i++)
{
Response.Write("X");
}
}
}
}