title: MVC equivalent to ASP.NET Button Click Event
body: <p>I need to create a page that has the equivalent to button click event in ASP.NET.</p>
  
  <p>On my page when the user clicks a button I need to process some information and if an error occured then display an Error page, but if it was successful I need to display a successful page. I'm new at MVC and I'm not sure how to go about this...</p>
  
  <p>This is what I've came up with so far (don't know if this will even work), I would create an ActionResult function to process the information then have the function decide which page should be displayed...</p>
  
  <pre><code>'//Foo page
  Function Foo(Byval param1 as String, Byval param2 as String) As ActionResult
      Return View()
  End Function
  
  Function FooProcess(Byval param1 as String, Byval param2 as String) As ActionResult
      '//Look up information and process
      '//bSuccess = process(param1, param2)
  
      '//If bSuccess Then
      '//  redirect to successful page
      '//else
      '//  redirect to error page
      '//end if
  End Function
  
  Function FooSuccessful() As ActionResult
      Return View()
  End Function
  
  Function FooError(ByVal msg As String) As ActionResult
      Return View()
  End Function
  </code></pre>