[已解决问题] VS怎么显示为一份试卷??
提问时间: 2008-08-21 13:27
悬赏分:10 浏览:203 次

用ASP.NET做网页怎样从数据库里读取试题和选项,然后将试题显示为一份试卷的形式??
都要用到什么样的控件好?
题型有:选择题,填空题,判断题,间答题....

提问者:aito - 初学一级
最佳答案
DataList
2008/8/21 13:55:55 回答者:漫步毛毛雨
其它回答(3)
动态生成
3个月前   回答者:绝版色狼 - 菜鸟二级
什么叫“间答题”?
2个月前   回答者:Alynx - 初学一级
每种题型一个userControl,动态生成
2个月前   回答者:天启 - 菜鸟二级
评论
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

   您需要登录以后才能回答!
 

我要提问

我的问题


快到期问题



> 问题排行榜

相关内容

相关链接