I am new to MVC (coming from Web Forms). I have a controller with two actions like this:
Public Function Delete(ByVal id As Nullable(Of Integer)) As ActionResult
Dim Count As Integer = IModel.DeleteMember(id)
If Count = 1 Then
ViewBag.Message = "Member " & id & " was deleted. "
Else
ViewBag.Message = "There was a problem deleting the record. "
End If
Return RedirectToAction("Members")
End Function
ViewBag is not passed to the Members view. Why?