悬赏分:10 浏览:203 次
用ASP.NET做网页怎样从数据库里读取试题和选项,然后将试题显示为一份试卷的形式??
都要用到什么样的控件好?
题型有:选择题,填空题,判断题,间答题....
|
2个月前 aito : 怎样动态生成??可不可说明白点?? |
|
2个月前 aito : 呵呵,是简答题 |
|
2个月前 绝版色狼 : 在页面上放一个服务器端的表格(我是这么做的)然后根据数据库里取出来的题 Textbox tb=new textbox(); tb.id=tb+数据库id 然后在把这个控见往表格里添加那天可以给你找个例子,不过为东西布局不好调,在提交时也会访问一下数据库的 |
|
2个月前 aito : 好啊,能找到例子实在太感激你了!!先谢过了! |
|
2个月前 绝版色狼 : private void DataBindRole() { int count = 0; int tabCount = 0; int j = 0; string strRID = string.Empty; string strState = string.Empty; string strRoleName = string.Empty; DataView dv = new DataView(); dv = GetRole(); count = dv.Count; tabCount = count / 2; if (tabCount == 0) tabCount = 1; else { tabCount = tabCount + 1; } for (int i = 0; i < tabCount; i++) { TableRow tr = new TableRow(); for (int i1 = 0; i1 < 2; i1++) { TableCell tc = new TableCell(); tc.Width = Unit.Parse("300"); if (j < dv.Count) { if (dv[j]["RID"] != DBNull.Value) strRID = dv[j]["RID"].ToString(); else break; if (dv[j]["RoleName"] != DBNull.Value) strRoleName = dv[j]["RoleName"].ToString(); else strRoleName = ""; if (dv[j]["State"] != DBNull.Value) strState = dv[j]["State"].ToString(); else strState = "0"; j = j + 1; CheckBox cb = new CheckBox(); cb.ID = "cb" + strRID; cb.Text = strRoleName; if (strState == "0") { cb.Checked = false; } else |