如何使用c#在Web窗体上将URL列表显示为超链接

时间:2019-05-10 01:47:34

标签: c# webforms

我正在c#中建立一个新项目作为Google搜索,并希望在Web窗体的主体上以超链接的形式显示URL(字符串)列表

 List<int> DD = new List<int>();

 while (sReader1.Read())
      {
       if (Int32.Parse(sReader1["DocID"].ToString()) == DocNum[m] && 
                               !DD.Contains(DocNum[m]))
         {
           DD.Add(DocNum[m]);
           string link = sReader1["URL"].ToString();
           ListBox1.Items.Add(link);

          }

      }

HTML

 <p style="width: 892px">
  <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" Height="281px" 
  style="margin-left: 4px" Width="1200px"></asp:ListBox>
 </p>   

0 个答案:

没有答案