|

April 12th, 2010, 05:08 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 68
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
HTTP GET and HTTP POST
Thinking of implementing separate methods for Post and Get.
[Authorize(Roles = "Editor")]
[ValidateInput(false)]
publicActionResult EditArticle(int articleId, int? categoryId, string title, string summary, string body, string country, string state, string city, DateTime? releaseDate, DateTime? expireDate, bool? approved, bool? listed, bool? commentsEnabled, bool? onlyForMembers)
for Get
and
[AcceptVerbs(HttpVerbs.Post), Authorize(Roles = "Editor")]
[ValidateInput(false)]
publicActionResult EditArticle(int articleId, int? categoryId, string title, string summary, string body, string country, string state, string city, DateTime? releaseDate, DateTime? expireDate, bool? approved, bool? listed, bool? commentsEnabled, bool? onlyForMembers)
The Questions are will I need to set ValidationInput(true) or can I leave as is.
Also how should I handle this part of the code.
if (IsPostBack)
{
approved = approved ?? false;
listed = listed ?? false;
commentsEnabled = commentsEnabled ?? false;
onlyForMembers = onlyForMembers ?? false;
}
because I now know it is a post. Do I just remove the If(IsPostback)

|