I have the following functions in my ProceduresControlller:
Function Add(ByVal bpid As Integer) As ActionResult
Return View(GetAvailableProcedures(bpid))
End Function
<AcceptVerbs(HttpVerbs.Post)> _
Function Add(ByVal bpid As Integer, ByVal code As String, ByVal covered As Boolean) As ActionResult
AddProcedure(bpid, codes, covered)
Return View("Close")
End Function
I'm loading the Add dialog via jQuery like so:
$("#dialog").load(
"/Procedures/Add",
{ bpid: 123 },
function(data) {
alert(data);
});
This is failing because it's calling the Post method (where "covered" can't be empty) instead of the Get. I tried decorating the Get with <AcceptVerbs(HttpVerbs.Get)>
, but it doesn't change the outcome.
Why is this triggering the Post, and how do I get it to use the Get? I realize I could change the names to not be ambiguous, but I want to know why it won't pick the Get if I'm only passing "bpid".