开发者

How To Pass JSON into asp.net MVC3 controller formatted like below

开发者 https://www.devze.com 2023-03-26 04:01 出处:网络
I\'ve read Phil\'s article( http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx ) and still can\'t figure out how I can take json that looks like what I ha

I've read Phil's article ( http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx ) and still can't figure out how I can take json that looks like what I have below and pass it into my contro开发者_StackOverflow中文版ller. I don't have much control over formatting it so I need to take it like this and get the data out of it.

{
  "Id":"720",
  "SponsorName":"Bay Area Association of Database Developers",
  "ImageURL":"~/Images/Sponsors/baadd.org.jpg",
  "NavigateURL":"http://baadd.org/",
  "HoverOverText":"Bay Area Association of Database Developers",
  "Comment":"xx"
}

How To Pass JSON into asp.net MVC3 controller formatted like below


public class SponsorUpdateModel
{
  public int Id {get;set;}
  public string SponsorName {get;set;}
  public string ImageURL {get;set;}
  public string NavigateURL {get;set;}
  public string HoverOverText {get;set;}
  public string Comment {get;set;}
}


public ActionResult Update(SponsorUpdateModel model)
{
}
0

精彩评论

暂无评论...
验证码 换一张
取 消