如何在asp.net中使用他们的选项绑定多个问题和答案 [英] how to bind multiple question and answer with their option in asp.net

查看:75
本文介绍了如何在asp.net中使用他们的选项绑定多个问题和答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在做一个网络项目,我希望用他们的选项(如在线测试)绑定多个问题和答案,如果一个问题有他们的孩子问题,那么当我们选择任何父母问题中的选项然后根据那个孩子的问题是可见的



请访问此链接

http://postimg.org/image/98u5denyz/ [ ^ ]





i想要这种类型的结构

<当我们选择当前吸烟者然后根据这两个孩子的问题来说,这是

我的数据库结构是



http://postimg.org/image/b6p6kfk4t/ [ ^ ]



http://postimg.org/image/hth6dl2fb/ [ ^ ]



请帮帮我,告诉我这背后的逻辑是什么......



我的数据库重新调整此表链接如下我如何将它绑定在我的前端



http://postimg.org/image/4jdat7jcd/ [ ^ ]



谢谢&问候

Srishti

Hello,
I am doing a web project in which i want to bind multiple question and answer with their option (like online test) and if a question have their child question then when we select any option in parent question then according to that child question is visible

please visit this link
http://postimg.org/image/98u5denyz/[^]


i want this type of structure

in this when we select "Current Smoker" then according to this two child question comes

My database structure is

http://postimg.org/image/b6p6kfk4t/[^]

http://postimg.org/image/hth6dl2fb/[^]

please help me for this and tell me that what is logic behind this ....

my database retun this table linked below how can i bind it on my front end

http://postimg.org/image/4jdat7jcd/[^]

Thanks & regards
Srishti

推荐答案

<$ c中有一列父_id $ c>问题表。我想你可以使用它。



对于两个问题你现在使用...... 你是吗?暴露于... ,你可以将Column Parent_id 更新为5,即 Answer_Id 在答案表中当前吸烟者



这样,您可以联系。因此,当选择当前吸烟者时,您查询问题表格如...

There is one Column Parent _id in Question Table. I guess you can use that.

For the two questions "Do you currently use..." and "Are you exposed to...", you can update the Column Parent_id to 5, which is the Answer_Id for "Current Smoker" in Answer Table.

This way, you can relate. So, when "Current Smoker" is selected, you query to Question Table like...
SELECT Question_Id, Question FROM Questions WHERE Parent_id = 5



5( Answer_Id )在查询时从代码后面传递。



有意义吗?


5 (Answer_Id) is passed from code behind while querying.

Makes sense?


这篇关于如何在asp.net中使用他们的选项绑定多个问题和答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆