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


Top 5 Contributors of the Month
david stephan

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" %>
"server">
    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


<html>


<body>
    <form runat="server">
        


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


        


            start: 
            "TextBox2" runat="server">
        


        


            length: 
            "TextBox3" runat="server">
        


        


            "Label1" runat="server">
        


        


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


    form>
body>
html>



     

Further Readings:

Responses

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