在设计视图和源视图之间同步 RadioButtonList 中的项目
通过 Design 视图编辑 ASP.NET 页面上的 RadioButtonList 中的硬编码项列表后,我发现RadioButtonList 仍然不会更新到最新的项目列表,即项目仍然是更改之前的项目。
有没有办法同步“设计”视图中显示的内容和实际的 HTML 源代码?或者我是否必须删除 RadioButtonList 并重新创建它?
After editing the list of hardcoded items in a RadioButtonList on a ASP.NET page via the Design view, I find that the HTML source for the RadioButtonList still does not update to the latest list of items i.e items are still the ones before the changes.
Is there a way to synchronize what appears in the Design view and the actual HTML source? Or do I have to delete the RadioButtonList and recreate it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,终于明白了。我双击设计视图中的RadioButtonList,为SelectedIndexChanged添加事件处理程序,并且项目已刷新到最新版本。
然后,我取消了代码隐藏中添加的事件处理程序,并删除了源视图中 RadioButtonList 的 onselectedindexchanged 事件。
Ok, finally got it. I double-clicked the RadioButtonList in the Design View to add an event handler for SelectedIndexChanged and the items were refreshed to the latest version.
I then undid the addition of the event handler in the codebehind and deleted the onselectedindexchanged event for the RadioButtonList in the Source View.