<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dynamically_Generate_Row.aspx.cs" Inherits="Dynamically_Generate_Row" %>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Untitled Page <% for (int i=0; i<_nRowCount; i++) {%> <% } %> //File:Dynamically_Generate_Row.aspx.csusing System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class Dynamically_Generate_Row : System.Web.UI.Page{ public int _nRowCount=1; protected void Page_Load(object sender, EventArgs e) { if (null == Session["row_count"]) Session["row_count"] = "1"; _nRowCount = System.Convert.ToInt32(Session["row_count"]); } protected void OnCreateRow(object sender, EventArgs e) { if (null == Session["row_count"]) Session["row_count"] = "1"; else { int i = (System.Convert.ToInt32(Session["row_count"]) + 1); Session["row_count"] = i.ToString(); } _nRowCount = System.Convert.ToInt32(Session["row_count"]); }}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dynamically_Generate_Row.aspx.cs" Inherits="Dynamically_Generate_Row" %>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Untitled Page