If the parameter variable is not passed then this code throws an exception of "Conversion from string "" to type 'Date' is not valid."
this is my code.
Public Shared ReadOnly Property Request_projectStartDate() As Date
Get
Dim _value As String = Nothing
If Not HttpContext.Current.Request.QueryString("projectStartDate") Is Nothing Then
_value = HttpContext.Current.Request.QueryString("projectStartDate").ToString()
End If
Return CDate(_value)
End Get
End Property
_value_will beNothingifprojectStartDateis not on the query string.Nothing.