Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950
This is the forum to discuss the Wrox book ASP.NET MVC Website Programming Problem Design Solution by Nicholas Berardi, Al Katawazi, and Marco Bellinaso; ISBN: 9780470410950
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 25th, 2009, 07:44 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default Action Method to handle POST, ex. ManageUser

There is one version of the ManageUser action with the
"[Authorize(Roles = "Admin")]" attribute on it. In the ManageUser View, there is a <form method="post" action="ManageUser">

The way I understand it, there should be a ManageUser action with an
[AcceptVerbs("POST")] attribute, to handle what is posted by the user, right?

How come it is possible to do it in this way, when other Action methods has an overloaded version to handle POST?

I don't see the difference...
  #2 (permalink)  
Old September 8th, 2009, 04:14 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

Does anyone have an answer to this?
  #3 (permalink)  
Old September 14th, 2009, 05:57 PM
Registered User
 
Join Date: Sep 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A Post [AcceptVerbs] attribute isn't a requirement for an action to fire for a post. You only need a so-called "post overload" if you have two action methods with the same name, one for the get, which serves up a form, and one for the post of the form. A quote from ScotGu's blog:
http://weblogs.asp.net/scottgu/archi...sed.aspx#seven
"By default ASP.NET MVC now looks for an action method that explicitly supports the incoming http verb - and if one is not found will use the action method that doesn't have an explicit verb specified."

There's only one ManageUser action, and it fires for both get and posts.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
post method franta1346 Reporting Services 0 July 23rd, 2007 12:08 AM
Post Method Error spitz Classic ASP Databases 2 June 10th, 2005 05:31 AM
using post method urgently skyman763 General .NET 0 February 13th, 2005 10:42 AM
about post and get method csc820203 HTML Code Clinic 1 August 2nd, 2004 02:13 PM
Post Method? zhenwe1 Servlets 0 January 25th, 2004 01:17 PM



All times are GMT -4. The time now is 07:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.