the*_*mhz 2 .net vb.net asp.net
如果未传递参数变量,则此代码抛出"从字符串转换""到"类型'日期'无效的异常."
这是我的代码.
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
Run Code Online (Sandbox Code Playgroud)
Kam*_*aiz 14
您可以查看@Massimiliano报告的内容以及另外一项检查
If Request.QueryString.HasKeys() Then
// Check for specified querystrings...
If Not String.IsNullOrEmpty(Request.QueryString("projectStartDate")) Then
// Your logic
End If
End If
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12976 次 |
| 最近记录: |