Ok. I thought that was simple enough, but apparently not. When I have this combination:
Proxy:
.Proxy(Sub(proxy)
Dim prxy As New Ext.Net.AjaxProxy()
With prxy
.API.Create = Url.Content("~/Assignments/_AddTeam/")
.API.Read = Url.Content("~/Assignments/_GetTeams/") + MvcApplication.CurrentApplicationUser.EmployeeID.ToString()
.API.Update = Url.Content("~/Assignments/_EditTeam")
.API.Destroy = ""
.Json = True
.Reader.Add(New Ext.Net.JsonReader() With {.Root = "Data", .AutoDataBind = True})
End With
proxy.Add(prxy)
End Sub) _
With this code:
<HttpPost()>
Public Function _AddTeam(ByVal team As Models.CWTeam()) As Ext.Net.MVC.StoreResult
Dim grid As New Ext.Net.MVC.StoreResult()
If team IsNot Nothing Then
Dim results As New List(Of Models.CWTeam)
Dim svc As New Services.TeamService
For Each tm In team
Try
results.Add(svc.CreateTeam(tm))
grid.Data = results
Catch ex As SystemException
grid.Message = ex.Message
End Try
Next
Return grid
Else
Return grid
End If
End Function
It throws a build error. When setting up the grid for error handling, am I supposed to use some other construct than the Proxy in the Razor syntax?
My code builds fine when returning a regular ActionResult from the Function that returns a view.