I have two controllers with the same name. One with a [get] and the other with [post]. These two perform totally different functions. Why can't they be the same name?
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult AddCriteriaItem(CriteriaItemAddFormCollection ciafc)
{
return View(ciafc);
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult AddCriteriaItem(CriteriaItemAddFormCollection ciafc)
{
string GroupName = (string)Session["SelectedGroupName"];
//add group or tab
switch (ciafc.CriteriaID)
{
case (int)enums.Criterias.Tab:
Template.AddTab(ciafc.TemplateID, ciafc.name, ciafc.description);
Response.Redirect(Server.UrlDecode(ciafc.rtn));
break;
case (int)enums.Criterias.Group:
Template.AddGroup(ciafc.TemplateID, ciafc.name, ciafc.description, ciafc.TabName);
ViewData["CategoryID"] = ciafc.CategoryID;
Response.Redirect(Server.UrlDecode(ciafc.rtn));
break;
default:
if (!string.IsNullOrEmpty(GroupName.ToString()) && ciafc.CriteriaID > 0 && !string.IsNullOrEmpty(ciafc.TabName))
{
Template.AddCriteriaItem(ciafc.TabName, GroupName, ciafc.name, ciafc.description, ciafc.options, ciafc.CriteriaID, ciafc.TemplateID);
}
ViewData["rtn"] = Server.UrlDecode(ciafc.rtn);
ViewData["TemplateID"] = ciafc.TemplateID;
ViewData["CategoryID"] = ciafc.CategoryID;
break;
}
Response.Redirect(Server.UrlDecode(ciafc.rtn));
return View();
}