D
-D-
I'm new to .net and just learning c#.
I have the following code in vb and want to convert this to c#
Public Class PositionData
Private strText As String
Private strUrl As String
Public Sub New(ByVal strDisplayText As String, ByVal strURL As String)
Me.strText = strDisplayText
Me.strUrl = strURL
End Sub
Public ReadOnly Property DisplayText() As String
Get
Return strText
End Get
End Property
Public ReadOnly Property URL() As String
Get
Return strUrl
End Get
End Property
End Class
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim MenuItems As New ArrayList
MenuItems.Add(New PositionData("About Us", "About.aspx"))
MenuItems.Add(New PositionData("Contact Us", "Contact.aspx"))
MenuItems.Add(New PositionData("Customer Support", "Support.aspx"))
MenuItems.Add(New PositionData("Site Map", "sitemap.aspx"))
Repeater1.DataSource = MenuItems
Repeater1.DataBind()
End Sub
Any help is appreciated.
I have the following code in vb and want to convert this to c#
Public Class PositionData
Private strText As String
Private strUrl As String
Public Sub New(ByVal strDisplayText As String, ByVal strURL As String)
Me.strText = strDisplayText
Me.strUrl = strURL
End Sub
Public ReadOnly Property DisplayText() As String
Get
Return strText
End Get
End Property
Public ReadOnly Property URL() As String
Get
Return strUrl
End Get
End Property
End Class
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim MenuItems As New ArrayList
MenuItems.Add(New PositionData("About Us", "About.aspx"))
MenuItems.Add(New PositionData("Contact Us", "Contact.aspx"))
MenuItems.Add(New PositionData("Customer Support", "Support.aspx"))
MenuItems.Add(New PositionData("Site Map", "sitemap.aspx"))
Repeater1.DataSource = MenuItems
Repeater1.DataBind()
End Sub
Any help is appreciated.