<div id="htmlDiv" runat="server"></div>
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
sql sqlcon = new sql();//my business logic
ds = sqlcon.ExecuteDataSet("GetData");//fetched the data
if (ds.Tables[0].Rows.Count > 0)
{
string st = "<table border='0' cellspacing='0' cellpadding='0'>";
st += "<th align='center'>Table Header</th>";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
st += "<tr><td><span>" + ds.Tables[0].Rows[i]["Sno"].ToString() + "</span></td>";
st += "<td><span>" + ds.Tables[0].Rows[i]["Sname"].ToString() + "</span></td></tr>";
}
}
st += "</table>";
htmlDiv.InnerHtml = st;
}
Tag: Usging Html Tags in asp.net
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
sql sqlcon = new sql();//my business logic
ds = sqlcon.ExecuteDataSet("GetData");//fetched the data
if (ds.Tables[0].Rows.Count > 0)
{
string st = "<table border='0' cellspacing='0' cellpadding='0'>";
st += "<th align='center'>Table Header</th>";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
st += "<tr><td><span>" + ds.Tables[0].Rows[i]["Sno"].ToString() + "</span></td>";
st += "<td><span>" + ds.Tables[0].Rows[i]["Sname"].ToString() + "</span></td></tr>";
}
}
st += "</table>";
htmlDiv.InnerHtml = st;
}
Tag: Usging Html Tags in asp.net
No comments:
Post a Comment