i have Copied this code from above Complete Code.
And I have Problem Only This Code And Rest of code is working Properly I Have cheked It.
(BillPrepare.cs)
else if (btnAdd.Text == "Save")
{
if (txtFinYear.Text != "" && txtTrnDate.Text != "" && txtCgNo.Text != "" && drpName.Text != "" && txtDesg.Text != "" && txtPay.Text != "" && txtGp.Text != "" && txtBasicPay.Text != "" && txtDaRate.Text != "" && txtIncomeTax.Text != "" && txtCess.Text != "" && txtDoPartNo.Text != "" && txtDoPartDate.Text != "")
{
IncrementCgNo();
con.Open();
OleDbCommand cmd11 = new OleDbCommand("select Dcode from pis.Designation_table where Designation='" + txtDesg.Text + "' ", con);
var i = cmd11.ExecuteScalar();
//OleDbCommand cmd1 = new OleDbCommand("Update pis.Designation_table set Dcode=i where Designation='" + txtDesg.Text + "'", con);
//var j = cmd1.ExecuteScalar();
OleDbCommand cmd31 = new OleDbCommand("insert into Encashment(Fy,cgno,Cgdate,EmpNumber,Dcode,DoptNo,DoptDate,Pay,Gp,DaRate,DAAmt,ElDays,BillAmt,IncomeTax,Cess,TotalTax,NetAmt,itper) values ('" + txtFinYear.Text + "','" + txtCgNo.Text + "','" + Convert.ToDateTime(txtTrnDate.Text).Date.ToShortDateString() + "','" + drpName.SelectedValue + "','" + i + "','" + txtDoPartNo.Text + "','" + Convert.ToDateTime(txtDoPartDate.Text).Date.ToShortDateString() + "','" + txtPay.Text + "','" + txtGp.Text + "','" + txtDaRate.Text + "','" + txtDaAmount.Text + "','" + txtElEncashDay.Text + "','" + txtElEncashAmount.Text + "','" + txtIncomeTax.Text + "','" + txtCess.Text + "','" + txtTotalTax.Text + "','" + txtNetAmount.Text + "','"+drpItPer.SelectedItem+"') ", con);
cmd31.ExecuteNonQuery();
lblpmsg.Text = "Record Saved SucessFully !!!";
ModalPopupExtender1.Show();
EnableFalse();
con.Close();
btnAdd.Text = "Add";
btnCancel.Visible = false;
btnRemove.Visible = true;
int id = Convert.ToInt32(txtCgNo.Text);
Session["userid"] = id;
Response.Redirect("BillPrepare.aspx");
Session.RemoveAll();
Session["userid"] = id;
Response.Redirect("Send To JCDA.aspx");
Session.RemoveAll();
}
else {
lblpmsg.Text = "Record Sholud Not Be Empty !!!";
ModalPopupExtender1.Show();
}
}
}
onclick of save button pass session to another page in asp.net c#
that time Message Not Show And 'Session Passing Code' Removed then Message show Properly.