aspx
js或者Juqery照样用,不影响
<%@ Page Title="分配试卷" Language="C#" MasterPageFile="~/Teacher/Teacher.Master"
CodeBehind="TestArrangePapers.aspx.cs" Inherits="OnlineTest.Teacher.TestArrangePapers" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<link href="../css/Utitlity.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/Utility.js" type="text/javascript"></script>
<style>
.lst
{
width: 250px;
height: 150px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('#checkAll').click(function () {
// 全选或者取消全选
$('input[type=checkbox]').attr("checked", $(this).attr("checked"));
});
// 触发判断是否全选
$("input[type=checkbox]:not('#checkAll')").click(function () {
JudgeIsCheckedAll();
});
// 检测是否要勾选"全选"
function JudgeIsCheckedAll() {
var flag = true;
$("input[type=checkbox]:not('#checkAll')").each(function () {
if ($(this).attr("checked") == false) {
flag = false;
return false;
}
else {
flag = true;
}
});
if (flag) {
$('#checkAll').attr("checked", true);
}
else {
$('#checkAll').attr("checked", false);
}
}
// 下一步
$('#ContentPlaceHolder1_imgBtnImage').click(function () {
var papers = "";
$("input[type=checkbox]:not('#checkAll')").each(function () {
if ("" != $(this).val()) {
papers += $(this).next("input[type=hidden]").val() + ",";
}
else {
alert("您所填的信息不完整");
return false;
}
});
$('#ContentPlaceHolder1_hiddenPapers').val(papers);
});
});
</script>
<style type="text/css">
.tdBlue
{
background-image: url('../images/footbk.png');
background-repeat: repeat-x;
}
</style>
<table width="730" class="tablestyle">
<asp:HiddenField ID="hiddenClassIds" runat="server" />
<asp:HiddenField ID="hiddenPapers" runat="server" />
<tr>
<td style="background-image: url('../images/footbk.png'); background-repeat: repeat-x;
color: White; font-weight: bold; height: 46px;">
<div align="center">
可选的试卷</div>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 20px; padding-top: 20px">
<br />
<asp:GridView ID="GridView1" runat="server" DataKeyNames="id" AllowSorting="true"
CellPadding="5" GridLines="Both"
BorderColor="Black"
Width="90%">
<HeaderStyle BorderColor="Black" CssClass="tdBlue"
Height="30px" Font-Bold="True"
HorizontalAlign="Center" />
<RowStyle BorderColor="Black" Height="20px"
HorizontalAlign="Center" Font-Size="Small" />
<Columns>
<asp:TemplateField ItemStyle-Width="35px">
<HeaderTemplate>
<input id="checkAll" type="checkbox" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chk" runat="server"/>
<input type="hidden" value='<%#eval_r("ID")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="序号" ItemStyle-Width="65px">
<ItemTemplate>
<%# Container.DataItemIndex + 1 %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="试卷名称">
<ItemTemplate>
<%#eval_r("Name")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="课程名称">
<ItemTemplate>
<%#GetLesson(eval_r("LessonNum")).Name%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="出卷时间">
<ItemTemplate>
<%#eval_r("PaperTime") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="总分" ItemStyle-Width="65px">
<ItemTemplate>
<%#eval_r("Marks") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="审核状态" ItemStyle-Width="105px">
<ItemTemplate>