((Label)GridView1.Rows[0].FindControl("EFen")).Text)没有获取到值吗
1 0=1 2019-05-23 08:16:16 protected void Button1_ServerClick1(object sender, EventArgs e)
{
int WenJuanId = int.Parse(Request.QueryString["id"].ToString());
float fenshu =0;
float AFen = float.Parse(((Label)GridView1.Rows[0].FindControl("AFen")).Text);
float BFen = float.Parse(((Label)GridView1.Rows[0].FindControl("BFen")).Text);
float CFen = float.Parse(((Label)GridView1.Rows[0].FindControl("CFen")).Text);
float DFen = float.Parse(((Label)GridView1.Rows[0].FindControl("DFen")).Text);
float EFen = float.Parse(((Label)GridView1.Rows[0].FindControl("EFen")).Text);
foreach (GridViewRow dr in GridView1.Rows)
{
string str = "";
if (((RadioButton)dr.FindControl("RadioButton1")).Checked)
{
fenshu = fenshu + AFen;
}
else if (((RadioButton)dr.FindControl("RadioButton2")).Checked)
{
fenshu = fenshu + BFen;
}
else if (((RadioButton)dr.FindControl("RadioButton3")).Checked)
{
fenshu = fenshu + CFen;
}
else if (((RadioButton)dr.FindControl("RadioButton4")).Checked)
{
fenshu = fenshu + DFen;
}
else if (((RadioButton)dr.FindControl("RadioButton5")).Checked)
{
fenshu = fenshu + EFen;
}
}这个代码里面为什么累加没有结果值,是因为((Label)GridView1.Rows[0].FindControl("EFen")).Text)没有获取到值吗?
麻烦大家看一下,很急!!!!!