When using Ajax Uploader (a very cool component) and MVC, I ran into a situation where I needed the same signature for the HTTP GET and HTTP POST controller actions. The compiler wouldn't let me use the same name. The ActionName attribute solved that problem.
[ActionName( "UploadArtwork" )]
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult UploadArtworkGet(string dataMyComponentUses)
{
...
return View( "UploadArtwork" );
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UploadArtwork(string dataMyComponentUses)
{
...
return View( "UploadArtwork" );
}
No comments:
Post a Comment