Problems to be aware of when using the MVC Framework (4): ActionLink only performs Get operations

Source: Internet
Author: User
Tags actionlink
ActionLink generates a link string that only supports the GET Action download center (Model! Null) {(Html. BeginForm () {the download list purchases some photos at a cost and we will package them for you to download. You can add the images to the download box title number operation (variteminModel) {Html. Encode (it

ActionLink generates a link string that only supports the GET Action download center (Model! = Null) {(Html. BeginForm () {the download list purchases some photos at a cost and we will package them for you to download. When browsing images, you can add them to the title number operation (var item in Model) {= Html. Encode (it

ActionLink generates a link string, website space, and VM. It only supports the GET Action download center (Model! = Null) {(Html. BeginForm () {the download list purchases some photos at a cost and we will package them for you to download. When browsing images, you can add them to the server space and add them to the title number operation (var item in Model) {= Html. encode (item. title) = Html. encode (item. path) <% = Html. actionLink ("delete", "DeleteFromDownloadList", new {id = item. path}) % >}%><%} else {%> sorry, you do not have any download list <%}. The code in Controller [Authorize] public ActionResult DeleteFromDownloadList (string id) {string profileKey = "DownloadList"; ProfileBase profile = ProfileBase. create (User. identity. name); Models. D OwnloadList list = profile. GetPropertyValue (profileKey) as Models. DownloadList; if (list! = Null & list. Items! = Null) {list. items. remove (list. items. firstOrDefault (I => I. path. equals (id); profile. save ();} return RedirectToAction ("Download ");}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.