如何查找一个Panel中的一个GridView中的ItemTemplate项中某一个控件(如:Label)的值?
解决方案 »
- 网站维护问题!!!急救
- 请教C++代码封装成C#dll用来调用方法
- 大家帮我分析下这个判断
- 请推荐一本asp.net中级学者(vb.net)和一本CSS的书。
- 请C#一正规表达式,检查是否为a-zA-ZA0123456789_-,其它全为无效
- 在双击DataGrid中的某行后跳转到另一页并显示该行的内容,请问这怎么做?
- 错误信息"超时时间已到。在操作完成之前超时时间已过或服务器未响应。"是什么原因啊?
- 输入控件TextBox问题!
- ASPxDateEdit 页面显示 当前日期和时间
- ASP.net做的Web应用程序如何打包发布?
- c# oracle 过程出现提取违反顺序 错误
- 求解 HTTP/1.1 404 Object Not Found
这是怎么回事?
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label24" runat="server" Text="一、单选题"> </asp:Label>
<br />
<br />
</HeaderTemplate>
<ItemTemplate>
<table ID="Table2" align="center" border="0" cellpadding="1" cellspacing="1"
width="100%">
<tr>
<td colspan="3">
<asp:Label ID="Label1" runat="server" Text="<%# Container.DataItemIndex+1 %>">
</asp:Label>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Que_subject","、{0}") %>'></asp:Label>
<asp:Label ID="lblSingle" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="35%">
<asp:RadioButton ID="RadioButton1" runat="server" GroupName="Sl"
Text='<%#Eval("OptionA","A、{0}") %>' />
</td>
<td width="35%">
<asp:RadioButton ID="RadioButton2" runat="server" GroupName="Sl"
Text='<%#Eval("OptionB","B、{0}") %>' />
</td>
<td>
</td>
</tr>
<tr>
<td width="35%">
<asp:RadioButton ID="RadioButton3" runat="server" GroupName="Sl"
Text='<%#Eval("OptionC","C、{0}") %>' />
</td>
<td width="35%">
<asp:RadioButton ID="RadioButton4" runat="server" GroupName="Sl"
Text='<%#Eval("OptionD","D、{0}") %>' />
</td>
<td>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
{
string insertpaper = "insert into Taoti(LessonID,Name,JoinTime) values(" + int.Parse(ddlCourse.SelectedValue) + ",'" + txtPaperName.Text + "','" + DateTime.Now + "');SELECT @@IDENTITY as id"; int afterID = TaoTiManager.GetIDInsert(insertpaper);//保存试卷,并返回自动生成的试卷编号 if (afterID > 0)
{ foreach (GridViewRow dr in GridView1.Rows)//保存试卷单选题信息
{
string single = "insert into TaotiDetail(TaotiId,Type,TitleID,Mark) values(" + afterID + ",'1'," + int.Parse(((Label)dr.Controls[0].FindControl("lblSingle")).Text) + "," + int.Parse(txtSingleFen.Text) + ")"; TaotiDetailManager.Insert(single); } foreach (GridViewRow dr in GridView2.Rows)//保存试卷多选题信息
{
string multi = "insert into TaotiDetail(TaotiId,Type,TitleID,Mark) values(" + afterID + ",'2'," + int.Parse(((Label)dr.Controls[0].FindControl("lblMulti")).Text) + "," + int.Parse(txtMultiFen.Text) + ")"; TaotiDetailManager.Insert(multi);
} foreach (GridViewRow dr in GridView3.Rows)//保存试卷填空题信息
{
string Tk = "insert into TaotiDetail(TaotiId,Type,TitleID,Mark) values(" + afterID + ",'3'," + int.Parse(((Label)dr.Controls[0].FindControl("lblTk")).Text) + "," + int.Parse(txtTkFen.Text) + ")"; TaotiDetailManager.Insert(Tk);
} foreach (GridViewRow dr in GridView4.Rows)//保存试卷判断题信息
{
string Pd = "insert into TaotiDetail(TaotiId,Type,TitleID,Mark) values(" + afterID + ",'4'," + int.Parse(((Label)dr.Controls[0].FindControl("lblPd")).Text) + "," + int.Parse(txtPdFen.Text) + ")"; TaotiDetailManager.Insert(Pd);
} Response.Write("<script language=javascript>alert('保存成功');location='taoti_xinxi.aspx'</script>");
}
}搞定了。呵呵。。