数据库的结构是这样的
testitemid int 主键
testid int 外键
itemname nvarchar
select1 nvarchar
score1 int
select2 nvarchar
score2 int
select3 nvarchar
score3 int
select4 nvarchar
score4 int
select5 nvarchar
score5 int
每个testid对应最少一个testitemid(对应的testitemid个数也不确定),每个testitemid最少对应了一个select1和score1,最多对应5对select和score(对应的select和score对数不一定)我想要在页面上显示如下的效果
itemname1
单选按钮 select1 score1
单选按钮 select2 score2 (其中select2-select5如果有则显示,没有则不显示)
单选按钮 select3 score3
单选按钮 select4 score4
单选按钮 select5 score5
itemname2 (其中itemname2-itemname...如果有则显示,没有则不显示)
单选按钮 select1 score1
单选按钮 select2 score2 (其中select2-select5如果有则显示,没有则不显示)
单选按钮 select3 score3
单选按钮 select4 score4
单选按钮 select5 score5
itemname3
单选按钮 select1 score1
单选按钮 select2 score2 (其中select2-select5如果有则显示,没有则不显示)
单选按钮 select3 score3
单选按钮 select4 score4
单选按钮 select5 score5
... ... ...C#代码分离模式,机构越简单明了越好
请写完整详细一点
偶好好学习学习
谢谢~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
testitemid int 主键
testid int 外键
itemname nvarchar
select1 nvarchar
score1 int
select2 nvarchar
score2 int
select3 nvarchar
score3 int
select4 nvarchar
score4 int
select5 nvarchar
score5 int
每个testid对应最少一个testitemid(对应的testitemid个数也不确定),每个testitemid最少对应了一个select1和score1,最多对应5对select和score(对应的select和score对数不一定)我想要在页面上显示如下的效果
itemname1
单选按钮 select1 score1
单选按钮 select2 score2 (其中select2-select5如果有则显示,没有则不显示)
单选按钮 select3 score3
单选按钮 select4 score4
单选按钮 select5 score5
itemname2 (其中itemname2-itemname...如果有则显示,没有则不显示)
单选按钮 select1 score1
单选按钮 select2 score2 (其中select2-select5如果有则显示,没有则不显示)
单选按钮 select3 score3
单选按钮 select4 score4
单选按钮 select5 score5
itemname3
单选按钮 select1 score1
单选按钮 select2 score2 (其中select2-select5如果有则显示,没有则不显示)
单选按钮 select3 score3
单选按钮 select4 score4
单选按钮 select5 score5
... ... ...C#代码分离模式,机构越简单明了越好
请写完整详细一点
偶好好学习学习
谢谢~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
testitemid testid itemname select1 score1 select2 score2 select3 score3 select3 score3
1 1 测试项1 是 1 不知道 2 不是 3
2 1 测试项2 是 1 不知道 2 不是 3 有时 4
3 1 测试项3 是 1 不知道 2 不是 3 有时 4
4 2 测试项1 是 1 不知道 2 不是 3 有时 4
5 2 测试项1 是 1 不知道 2 不是 3 有时 4
6 2 测试项1 是 1 不是 2
7 2 测试项1 是 1 不是 2
我想要的效果是
当我传到的参数是testid=1时,在这个页面显示testid=1的所有itemname以及其select和score
效果如下
测试项1
单选按钮 是 1
单选按钮 不知道 2
单选按钮 不是 3测试项2
单选按钮 是 1
单选按钮 不知道 2
单选按钮 不是 3
单选按钮 有时 4测试项3
单选按钮 是 1
单选按钮 不知道 2
单选按钮 不是 3
单选按钮 有时 4
在頁面托一個gridview1
然後gridview1
模板中放一個table
一列綁定itemname1
一列放一個gridview2,然後gridivew2綁定你要顯示的字段然後在gridview2_Rowdatabound事件中格式化(沒有就不顯示)就可以了....
不会写呀
麻烦一下
谢谢~~~~~~~~~~~~~~~~~~~~~~~