我如何使用VisualBasic中的WebControls元素添加UL LI列表元素
我正在一个旧项目中工作,创建一个用户控件,以添加将根据需要更改的代码。 我想添加一个列表元素,但我只找到属性来创建< select>
使用< asp:listbox
的列表类型,但这不是那样我正在寻找
您知道如何使用global.system.web.ui.webcontrols生成< ul>或至少自从我的VB代码以来,至少修改其CSSClass属性。如果我可以使用循环生成列表项目,那就太神奇了。
提前致谢
I'm working in an old project creating a User Control to add code that will change as I need.
I'd like to add a list element but I only found the property to create list type of <select>
using <asp:ListBox
, but this is not that I'm looking for
Do you know how generate a <ul><li>
elements using Global.System.Web.UI.WebControls? or at least modify its CssClass properties since my VB code. It'd be amazing if I can use a loop to generate the list items.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种解决方案是在
webform.aspx
中添加bueltedlist
:然后在您的
webform.aspx.vb
中,您可以添加项目:如果您在Web浏览器中检查您的页面,您会看到这些页面等效于
&lt; ul&gt;&lt; li&gt;
html标签。One solution would be to add a
BulletedList
in yourWebForm.aspx
:Then in your
WebForm.aspx.vb
you can add items:If you inspect your page in a web browser you will see these are equivalent to
<ul><li>
HTML tags.