且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将asp.net中的对象绑定到几个列表框和下拉列表之后的控件

更新时间:2023-10-07 16:36:04


我遍历了您的代码,这没有错.
因此,我的答案是基于您写的最后一个衬纸:

您已将自动回发设置为true:这将成为问题的根源.

1)首先,回答自己.您是否需要在那儿发帖?
-对我来说,应避免发回邮件.
2)您可能在页面上禁用了viewstate,因此这些控件的状态不会在回发之间保留.因此,请在@Page指令的aspx页面中将enable view state属性设置为true.
Hi,
I went through your code and there is nothing wrong about it.
So, My answer is based on the last one liner you wrote:

You have set the auto post back true: That will be the source of the issue.

1) First of all, answer yourself Do you need a post back there?
- To me postback should be avoided.
2) You might disabled viewstate on your page and hence state of these controls is not retained across post backs. So set enable view state property to true in the aspx page in the @Page directive.
EnableViewState="true"


请看看以上两点是否对您有帮助.否则,请告诉我.


Just see if the above two points help you. Otherwise, please let me know.