J
jonefer
Please help, I'm using a converter to translate some C# code.
The following code written in C# does not translate well to Visual Basic
(If I paste it in a C# page, however it has no problems compiling)
//C# Code.....
private string GridViewSortDirection
{
get { return ViewState["SortDirection"] as string ?? "ASC"; }
set { ViewState["SortDirection"] = value; }
}
private string GridViewSortExpression
{
get { return ViewState["SortExpression"] as string ?? string.Empty; }
set { ViewState["SortExpression"] = value; }
}
' Here is the VB equivalent
Private Property GridViewSortDirection() As String
Get
Return ViewState("SortDirection") as String ?? "ASC"
End Get
Set (ByVal Value As String)
ViewState("SortDirection") = value
End Set
End Property
Private Property GridViewSortExpression() As String
Get
Return ViewState("SortExpression") as String ?? String.Empty
End Get
Set (ByVal Value As String)
ViewState("SortExpression") = value
End Set
End Property
'----------------------------------------------------------------
' Converted from C# to VB .NET using CSharpToVBConverter(1.2).
' Developed by: Kamal Patel (http://www.KamalPatel.net)
'----------------------------------------------------------------
The following code written in C# does not translate well to Visual Basic
(If I paste it in a C# page, however it has no problems compiling)
//C# Code.....
private string GridViewSortDirection
{
get { return ViewState["SortDirection"] as string ?? "ASC"; }
set { ViewState["SortDirection"] = value; }
}
private string GridViewSortExpression
{
get { return ViewState["SortExpression"] as string ?? string.Empty; }
set { ViewState["SortExpression"] = value; }
}
' Here is the VB equivalent
Private Property GridViewSortDirection() As String
Get
Return ViewState("SortDirection") as String ?? "ASC"
End Get
Set (ByVal Value As String)
ViewState("SortDirection") = value
End Set
End Property
Private Property GridViewSortExpression() As String
Get
Return ViewState("SortExpression") as String ?? String.Empty
End Get
Set (ByVal Value As String)
ViewState("SortExpression") = value
End Set
End Property
'----------------------------------------------------------------
' Converted from C# to VB .NET using CSharpToVBConverter(1.2).
' Developed by: Kamal Patel (http://www.KamalPatel.net)
'----------------------------------------------------------------