Subroutine question

I have been assuming that if a subroutine moves the user to a different WebPage, the calling routine would still keep going. So if I want the calling routine to stop if the subroutine sends the user a different WebPage, I need to issue a Return value, or set a property, that the calling routine tests for. For example:

WebPage1.Method1 calls WebPage1.Method2
WebPage1.Method2 tests for a database error and finds one, so loads WebPage2 where user sees an error message.

Can I assume that WebPage1.Method1 will stop when WebPage2 is called? I have been doing it the following way, assuming moving to a different page would NOT necessarily stop the calling method:

SUB WebPage1.Method1 [some code] SUB WebPage.Method2 [some code] If finds DB error Then WebPage1.DBErrorFound = 1 // sets a property to 1 WebPage2.Show // moves user to error message page Return END SUB If WebPage1.DBErrorFound = 1 Then Return End If END SUB

Method2 would stop running right at the line where the “Return” is encountered

SUB WebPage1.Method1
      Method2()
      If WebPage1.DBErrorFound = 1 Then
            Return
      End If
END SUB

SUB WebPage.Method2
            [some code]
            If finds DB error Then
                  WebPage1.DBErrorFound = 1      // sets a property to 1
                  WebPage2.Show      // moves user to error message page
                  Return
END SUB

But if you’re going to do this why not

SUB WebPage1.Method1
      if Method2() = true then // basically If method2 found an error
            Return
      End If
END SUB

Function WebPage.Method2() as boolean
            If finds DB error Then
                  WebPage2.Show      // moves user to error message page
                  Return true
            end if

// and you dont even have to return false as that IS the default

END function

That makes much more sense than what I was doing.