62,025
社区成员
发帖
与我相关
我的任务
分享
if (e.Row.RowType == DataControlRowType.DataRow)
{
RadioButtonList rabut_v1 = new RadioButtonList();
rabut_v1.ID = "rabut_v1";
rabut_v1.Items.Add(new ListItem("是", "1"));
rabut_v1.Items.Add(new ListItem("否", "0"));
rabut_v1.RepeatDirection = RepeatDirection.Horizontal;
TextBox txt_svalue1 = (TextBox)e.Row.FindControl("txt_svalue1");
TextBox txt_svalue2 = (TextBox)e.Row.FindControl("txt_svalue2");
Label lab_value = (Label)e.Row.FindControl("lab_value");
if (txt_svalue1.ToolTip == "B")
{
if (txt_svalue1.Text == "1.0000")
{
rabut_v1.SelectedIndex = 0;
}
else
{
rabut_v1.SelectedIndex = 1;
}
e.Row.Cells[1].Controls.Remove(txt_svalue1);
e.Row.Cells[1].Controls.Remove(txt_svalue2);
e.Row.Cells[1].Controls.Remove(lab_value);
e.Row.Cells[1].Controls.Add(rabut_v1);
}
else if (txt_svalue1.ToolTip == "V")
{
txt_svalue1.ToolTip = "";
}
}
for (int i = 0; i < GridView1.Rows.Count; i++)
{
Label lab_names = (Label)GridView1.Rows[i].FindControl("lab_names");
modguide = bllguide.GetModel(sid, lab_names.ToolTip);
if (modguide.stsave =="B")
{
RadioButtonList rabut_v1 = (RadioButtonList)GridView1.Rows[i].Cells[1].Controls[1];
modguide.svalue1 = Decimal.Parse(rabut_v1.SelectedValue);
bllguide.Update(modguide);
}
else if (modguide.stsave == "V")
{
TextBox txt_svalue1 = (TextBox)GridView1.Rows[i].FindControl("txt_svalue1");
TextBox txt_svalue2 = (TextBox)GridView1.Rows[i].FindControl("txt_svalue2");
modguide.svalue1 = Decimal.Parse(txt_svalue1.Text);
modguide.svalue2 = Decimal.Parse(txt_svalue2.Text);
bllguide.Update(modguide);
}
}
<body>
<div id='divContent'></div>
</body>
var tmp = "<input type='text' id='txt1' value='xxx' />";
div.innerHTML += tmp;
Request.Form["txt1"]
RadioButtonList rabut_v1 = (RadioButtonList )e.Row.FindControl("rabut_v1");
Page.FindControls("rabut_v1")
RadioButtonList rabut_v1 = (RadioButtonList )e.Row.FindControl("txt_rabut");