我不确定为什么这不起作用。
我正在验证登录的人是否具有正确的安全性,如果他们不希望将他们重定向到另一个页面。
如果它们确实具有正确的安全性,则页面上的其余代码将继续执行。
当我单步执行代码时,它确实执行了 response.redirect,但页面继续加载。
strSQL = "Select * from tblSecurity Where SFID = '" & Right(My.User.Name, 4) & "' and (SecurityLevel = '900' or SecurityLevel = '850')"
ds = objData.SQLExecuteDataset(strSQL, CommandType.Text)
If ds.Tables(0).Rows.Count = 0 Then
Response.Redirect("~/NotAuthorized.aspx", False)
End If