通过Web窗体VB.NET 3.5上的按钮循环 [英] looping thru buttons on a web form VB.NET 3.5
本文介绍了通过Web窗体VB.NET 3.5上的按钮循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个带有许多表示时隙的按钮的Web表单.我希望用户单击插槽并进行预订,然后将结果存储在数据库中.当我第一次打开Web表单时,我需要一种方法来循环浏览按钮,并使用数据库中的条目填充按钮的标签(以显示已经预订的按钮槽).
如何让VB遍历名为slot1,slot2,slot3等的按钮?
I created a web form with many button representing time slots. I want users to click on the slots and book it, and store the results in a database. When I first open the web form, I need a way to loop through the buttons and populate their labels with the entries in the database (to show those button slots that have already been booked).
How can I get VB to loop through the buttons, which are named as slot1, slot2, slot3, etc?
Thanks for any pointers.
推荐答案
为什么不能从page_load或page_init事件背后的代码中添加按钮.然后,您可以分配任何属性,并分配任何处理程序,然后再将其呈现给客户端.
困难在哪里?
Why can''t you add the button''s from the code behind page_load or page_init event. Then you can assign whatever properties and assign whatever handlers before rendering it to the client.
What is the difficulty in it?
这篇关于通过Web窗体VB.NET 3.5上的按钮循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文