Reputation: 9555
Is it possible to return an Exit from a function?
So that I can exit the Page_Load function using the function MyExit
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MyExit() 'Exit
End Sub
Private Function MyExit() As Exit
Return Exit
End Function
Upvotes: 0
Views: 109
Reputation: 9888
No, but you can set a flag like this:
Protected Sub Page_Load()
Dim bExit as Boolean = MyExit()
If bExit then Exit
End Sub
Private Function MyExit() As Boolean
Dim bOk as Boolean
'[...]
Return bOk
End Function
Upvotes: 2