I want to redirect page after insert record into database
below is button save code.
protected void Save_Click(object sender, EventArgs e)
{
if (DDLCus.SelectedValue == "0")
{
Response.Write("<script>alert('Please Input Customer Name')</script>");
}
else
{
using (SqlCommand cmd = new SqlCommand("SP_insert_Order", con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Action", "Master");
cmd.Parameters.AddWithValue("@Order_ID", lbid.Text);
cmd.Parameters.AddWithValue("@Order_date", DateTime.Now.ToString());
cmd.Parameters.AddWithValue("@C_ID", DDLCus.SelectedValue);
cmd.Parameters.AddWithValue("@Order_Amount", txtamount.Text);
cmd.Parameters.AddWithValue("@Delivery_Date",txtdeliverydate.Text);
cmd.Parameters.AddWithValue("@Order_Remakrs", txtremarks.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
insertcheck();
}
{
foreach (GridViewRow row in gvv.Rows)
{
if (!string.IsNullOrEmpty((row.FindControl("I_ID") as Label).Text.Trim()))
{
int i_id = Convert.ToInt32((row.FindControl("I_ID") as Label).Text.Trim());
TextBox txtsize = (row.FindControl("Size") as TextBox);
Insert((Decimal.Parse(txtsize.Text).ToString()), i_id);
}
}
}
}
}