On the code below the Exit Function shows a green line under it saying
Null reference exception not all paths return a value.
How do I exit and on exit make it return something?
Can you please help?
Protected Sub Page_Load()
test()
End Sub
Function test() As String
Exit Function
Return ""
End Function
Just remove the
Exit Functionline and return what you want. Or do you want to exit the program entirely? They’re two different things.