Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Karl 21 posts 133 karma points
    Dec 18, 2012 @ 16:54
    Karl
    0

    Can't get ActionLink to work

    Hi there,

    I've just upgraded my Umbraco solution to 4.11 and am trying out the new MVC functionality. I'm having a problem getting ActionLink to work:

    Using 

    @Html.ActionLink("Update Quantity", "UpdateQuantity", "Cart") 

    Returns: 

    <a href="">Update Quantity</a>

    I thought the route might be wrong, however the following creates a button that does submit to the correct method in my controller:

    @using (Html.BeginUmbracoForm("UpdateQuantity", "Cart")) {
    @Html.TextBox("txtQuantity", eachOrderLine.Quantity, new { @class = "qty" })
    <input type="submit" value="test" />
    }

    For referrence, here is my controller code:

    namespace CRuMbraco.Web.Controllers {
        public class CartController : RenderMvcController {
            public override ActionResult Index(RenderModel model) {
                var currentOrder = OrderHelper.GetCurrentContextOrder();
                ViewBag.PurchaseOrder = currentOrder;
                return CurrentTemplate(model);
            }
            public ActionResult UpdateQuantity(RenderModel model) {
                return CurrentTemplate(model);
            }
        }
    }

    Any suggestions very welcome,

    Karl

     

  • Karl 21 posts 133 karma points
    Jan 02, 2013 @ 10:09
    Karl
    102

    I now understand that it's only possible to create action links to surface controllers.

Please Sign in or register to post replies

Write your reply to:

Draft