Add to List from codebehind C# Asp.net

后端 未结 5 1117
春和景丽
春和景丽 2020-12-09 03:10

I have a UL list in a ASPX page:

  • Tab 1
5条回答
  •  粉色の甜心
    2020-12-09 03:38

    Use asp:bulletedList and your list will be much easier.

    
        tab1
        tab2
        tab3
    
    

    Code Behind:

        ListItem li = new ListItem();
        li.Value = "*.html";  //html goes here i.e.  xtab1.html
        li.Text = "New Text";  //text name goes i.e. here tab1
        blTabs.Items.Add(li);
    

提交回复
热议问题