i have web page in this page i have input textbox using this textbox integer number creat row dynamically in gridview.but in this i want to use without query string and without page redirect.In current content i use query string and page redirect on current page. but i want to use page without page redirecting.code is given below.
SqlDataAdapter sqlda = new SqlDataAdapter();
SqlCommand com = new SqlCommand();
DataTable dt;
int size = 0;
string str;
public int RowCount
{
get
{
int returnValue = 0;
if (Request.QueryString["rows"] != null)
{
try
{
int.TryParse(Request.QueryString["rows"].ToString()
, out returnValue);
}
catch
{
messageLabel.Text = @"Invalid row count!
Go back to the <a href=""Default.aspx"">home page</a>
to enter a value!";
}
}
return returnValue;
}
}
protected void submitLinkButton_Click(object sender, EventArgs e)
{
Response.Redirect(String.Format("Roomreservation.aspx?rows={0}", DropDownList6.Text));
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Persons listOfPersons = new Persons(RowCount);
GridView1.DataSource = listOfPersons;
GridView1.DataBind();
}
}