在也有提交按钮的下拉列表上使用自动回发
将自动回发设置为“是”的下拉列表有另一个下拉列表框,该下拉列表框将根据第一个下拉列表的选择进行填充。它工作正常,直到我在表单上放置一个提交按钮。当我这样做时,在按下提交按钮之前,它似乎不会自动回发。您可以在具有自动回发活动下拉列表的表单上添加一个提交按钮吗?谢谢...
Have a dropdown list with autopostback set to 'yes' have another dropdown list box that will be populated based on the selection of the first dropdown. It works fine until I put a submit botton on the form. When I do it appears to not do the auto postback until the submit button is pushed. Can you have a submit button on a form that has a dropdown with autopostback active. thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然可以。
您是否正在处理代码隐藏文件中第一个下拉列表的自动回发事件以填充第二个下拉列表?如果是这样,当您更改第一个下拉列表中的选择时,应该会触发您的回发事件。在代码中放置断点以确保调用事件代码。
Sure you can.
Are you handling the autopostback event of the first dropdown in the code-behind file to populate the second dropdown? If so, your postback event should be firing when you change your selection in the first dropdown. Put a breakpoint in your code to assure that your event code is being called.
当然可以。您是否看到它没有加载第二个下拉列表?如果是这样,请检查您在哪里处理它,因为它可能位于错误的位置(如果您使用代码执行此操作),或者您可能不加考虑地将其包装在 !postback 中。发布更多代码和解释以获得更多帮助。
Sure you can. Are you seeing it not load the second dropdown? If so, check where you're handling that, as it may be in the wrong spot (if you're doing it with code) or you might have it wrapped in a !postback without thinking about it. Post more code and explanation for more help.