Controls versus standard HTML

后端 未结 11 1499
醉话见心
醉话见心 2020-12-15 09:55

I\'m getting into ASP.NET (C# - I know it doesn\'t matter for this particular question, but full disclosure and all that), and while I love that the asp:-style

11条回答
  •  失恋的感觉
    2020-12-15 10:24

    The HTML renders with those sort of IDs because its ASP.NET's way of preventing ID collisions. Each container control, such as a Master page or Wizard control, will prepend an "ID_" on its childrens' IDs.

    In the case of your bullet list, the ListView provides a nice middle ground. You can still bind it to a datasource, but it gives you much tighter control over the rendered HTML. Scott Gu has a nice intro to the ListView here:

    http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui.aspx

提交回复
热议问题