Dear Sir,
If user click on Settled then move to settled.aspx page if user click on pending then move to pending.aspx page from GridView row.
Server Error in '/bpm' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1061: 'System.Web.UI.WebControls.GridViewCommandEventArgs' does not contain a definition for 'Row' and no extension method 'Row' accepting a first argument of type 'System.Web.UI.WebControls.GridViewCommandEventArgs' could be found (are you missing a using directive or an assembly reference?) Source Error:
Line 73: GridViewRow Row = GridView1.Rows[index];
Line 74:
Line 75: if (e.Row.RowType == DataControlRowType.DataRow)
Line 76: {
Line 77: if (e.Row.Cells[13].Text == "Settled")
|
Source File: c:\inetpub\wwwroot\BPM\BPM\po_sts.aspx.cs Line: 75
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
if (Session["emp_nm"] == null)
Response.Redirect("Sssn.aspx");
else
{
String EmplooyeId = Session["emp_id"].ToString();
Label1.Text = " " + EmplooyeId + "";
String emp_nm = Session["emp_nm"].ToString();
Label2.Text = "" + emp_nm + " ";
String dept = Session["dept"].ToString();
Label3.Text = "" + dept + " ";
}
Label16.Text = String.Format("{0}", DateTime.Now.ToString("dd/MM/yyyy"));
}
private void BindGrid()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "SELECT Id, emp_id, emp_nm,dept,p_n,agcy,inc_no,inc_dt,inc_amt,prk_amnt,prk_nm,prk_dt,mrk_in_fa,amt_rls,amt_rls_dt,tds_gst,tds_it,ld,sd_pbg,instl_chrg,othr_ded,othr_ded_rsn,gnrl_rmk,stl,tda,gt,Fa_updt_dt,updt_b_id,updt_b_nm,updt_b_dpt,cnm_inst_dt FROM bpms WHERE p_n LIKE '%' + @p_n + '%'";
cmd.Connection = con;
cmd.Parameters.AddWithValue("@p_n", txtSearch.Text.Trim());
// cmd.Parameters.AddWithValue("@dept", Label3.Text.Trim());
DataTable dt = new DataTable();
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditButton")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow Row = GridView1.Rows[index];
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[13].Text == "Settled")
{
Response.Redirect("settled.aspx?Id=" + row.Cells[0].Text + "&EmplooyeId=" + Label1.Text + "&emp_nm=" + Label2.Text + "&dept=" + Label3.Text);
}
if (e.Row.Cells[13].Text == "pending")
{
Response.Redirect("pending.aspx?Id=" + row.Cells[0].Text + "&EmplooyeId=" + Label1.Text + "&emp_nm=" + Label2.Text + "&dept=" + Label3.Text);
}
}
}
}