功能性问题 [英] Functionality problem

查看:94
本文介绍了功能性问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有几个名为Category和Subcategory的表.它们由所有类别组成,并且在子类别表中由每个类别的所有子类别组成.这些以主"表格输入.

我有一个Web表单,其中必须将所有类别绑定到一个复选框中,
当检查每个类别的复选框我有其各自的子类绑定在另一复选框列表.我必须以同样的方式将每个类别中的所有子类别都绑定为true.

保存时,我必须保存所有子类别和类别,但是我如何确定哪个子类别属于哪个类别存在问题.为他们设计一个名称,该名称代表要呈现的类别/子类别的ID.将表单返回到服务器(已过帐)后,您将能够读取名称的值.

如果您使用的是ASP.NET和MVC,我有一条帖子 [ ^ ]有关高级模型绑定的信息,我将直接解决此问题.

干杯.


Hi All,

I have a couple of tables named Category and Subcategory. They consist of all categories and where in sub category table consist of all subcategory of each category. These are entered in the Master form.

I have a web form in which I have to bind all categories in a check box,
when each category check box is checked I have to bind its respective subcategory in another check box list. Same way I have to bind all Subcategories in each category checked true.

While saving I have to save all subcategories and categories but I have a problem with how I identify which subcateogry belongs to which category.

解决方案

When you generate your checkboxes be sure to craft a name for them that is representative of the ID of the category/subcategory that is being rendered. When your form is returned to the server (POSTed) you will be able to read the value of the name.

If you are using ASP.NET and MVC I have a post[^] on advanced model binding where I address this issue head-on.

Cheers.


这篇关于功能性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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