[ASP.NET] 在MVC 3上包JSON物件,送給Controller的方法

大家搞了好久才知道怎麼做。感謝Shawn的提供,我來筆記一下:)
根據 Posting JSON Data to an ASP.net MVC 3 Web Application 的解說,我們只要輸入透過ajax等技術,把要抓取的Web物件,封裝好後,丟給後端的MVC Controller協助處理就好囉。
程式碼大概長成下面這樣:

若想進一步研究,我有以下三個不錯的連結提供給各位:
1. http://social.msdn.microsoft.com/Forums/zh-TW/236/thread/0ab6d592-8ded-4b34-a396-229c319b54ee
2. http://stackoverflow.com/questions/309115/how-can-i-post-an-array-of-string-to-asp-net-mvc-controller-without-a-form
3. http://stackoverflow.com/questions/5251992/using-jquery-post-for-mvc-3-not-working-when-deployed

This entry was posted in ajax, ASP.NET, jQuery, 程式設計, 網頁撰寫. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *