![]() |
#2
yms1232012-02-25 17:59
![]() using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string SelVal = this.DropDownList1.SelectedItem.Text; switch (SelVal) { case "出勤": Response.Write("这是出勤的代码"); break; case "旷课": Response.Write("旷课的代码"); break; case "迟到": Response.Write("迟到的代码"); break; case "早退": Response.Write("早退的代码"); break; case "违纪": Response.Write("违纪的代码"); break; } } } } .cs的代码 ![]() <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Selected="True" Value="+5">出勤</asp:ListItem> <asp:ListItem Value="-3">旷课</asp:ListItem> <asp:ListItem Value="-3">迟到</asp:ListItem> <asp:ListItem Value="-3">早退</asp:ListItem> <asp:ListItem Value="-5">违纪</asp:ListItem> </asp:DropDownList> .aspx的代码 |
学生成绩评定系统:
网上测试,作业提交及老师打分、考勤和在线时长统计等各方面成绩的加权求和,先问下其中的考勤的算法。。
考勤分为五个部分:出勤,旷课,迟到,早退,违纪,分别分为+5-3-3-3-5分,考勤占总成绩的20%,折算成100分形式,这个算法应该怎么写。
<asp:DropDownList ID="DropDownList1" runat="server" Style="z-index: 107; left: 885px;
position: absolute; top: 381px" Width="64px">
<asp:ListItem Selected="True">出勤</asp:ListItem>
<asp:ListItem>旷课</asp:ListItem>
<asp:ListItem>迟到</asp:ListItem>
<asp:ListItem>早退</asp:ListItem>
<asp:ListItem>违纪</asp:ListItem>
</asp:DropDownList>怎么在里面加,格式不懂,求大家帮忙写个吧。。