.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Use asp:Label to create a bulleted list (VB.net)

Posted By:papsantony       Posted Date: August 13, 2010    Points: 10    Category: Visual Studio    URL: http://www.dotnetspark.com  

Use asp:Label to create a bulleted list (VB.net)

<%@ Page Language="VB" %>
    Sub Button1_Click(sender As Object, e As EventArgs)
      Dim fullString, subString As String
      Dim startPos, length As Integer
      startPos = CInt(TextBox2.Text)
      length = CInt(TextBox3.Text)
      fullString = TextBox1.Text
      subString = fullString.SubString(startPos, length)
      Label1.Text = subString
    End Sub
    Sub Button2_Click(sender As Object, e As EventArgs)
      Dim myString As String
      Dim myWords As String()
      myString = TextBox1.Text
      myWords = myString.Split(" ".toCharArray())
      ' Start bulleted list
      Label1.Text = "
          Dim word As String
          For Each word in myWords
            Label1.Text = Label1.Text & "
  • & word & "
  • "
          Next word
          ' End bulleted list
          Label1.Text = Label1.Text & "
    End Sub


    <form runat="server">

            "TextBox1" runat="server" TextMode="MultiLine" Width="259px" Height="112px">


            "TextBox2" runat="server">


            "TextBox3" runat="server">


            "Label1" runat="server">


            "Button1" onclick="Button1_Click" runat="server" Text="Show Substring">
             "Button2" onclick="Button2_Click" runat="server" Text="Split">



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend