Private Property gridSortExpression() As String
Get
If (ViewState("GridSortExpression") Is Nothing) Then
ViewState("GridSortExpression") = "DepartmentID"
End If
Return ViewState("GridSortExpression")
End Get
Set(ByVal value As String)
ViewState("GridSortExpression") = value
End Set
End Property
[highlight=C#]private string gridSortExpression
{
get
{
if (ViewState[“GridSortExpression”] == null)
{
ViewState[“GridSortExpression”] = “DepartmentID”;
}
return (string) ViewState[“GridSortExpression”];
}
set
{
ViewState[“GridSortExpression”] = value;
}
}
If you ever want to find a variable and you are using visual studio, you can usually right click on it and choose “go to declaration” to figure out where it is declared.