ASP.Net DropDownList 在转发器中共享数据源

发布于 2024-11-19 06:02:22 字数 370 浏览 4 评论 0原文

我有一个 ASP.net 转发器,其中包含 内的 DropDownList。我想将所有 DropDownList 绑定到单个数据源:

List<Status> statusList = QuoteRequestLogic.Instance.GetQuoteRequestStatusList();

我知道我可以附加到转发器的 ItemDataBound 事件,找到 DropDownList,并将其绑定到我的 List<状态>。这是最有效的方法吗?如果不是,那是什么?

提前致谢!

I have an ASP.net repeater that contains a DropDownList inside the <ItemTemplate>. I would like to bind all of the DropDownLists to a single data source:

List<Status> statusList = QuoteRequestLogic.Instance.GetQuoteRequestStatusList();

I know that I can attach to the ItemDataBound event of the repeater, find the DropDownList, and bind it to my List<Status>. Is this the most efficient method? If not, what is?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单挑你×的.吻 2024-11-26 06:02:22

我认为这可能是实现你想要的最好的方法

It is probably the best possible way to achieve what you want I think

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文