title: ReturnUrl has no value, ASP.Net MVC
body: <p>I've faced some problem recently and couldn't find the solution. I'm working on SportsStore from Adam Freeman's book Pro MVC 4. Look at this please:</p>
  
  <p>I have a View called Index:</p>
  
  <pre><code>@model WebUI.Models.CartIndexViewModel
  .
  .
  .
  &lt;p align="center" class="actionButtons"&gt;
      &lt;a href="@Model.ReturnUrl"&gt;Kontynuuj zakupy&lt;/a&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>CartController:</p>
  
  <pre><code>{
      public class CartController : Controller
      {
          private IProductRepository repository;
  
          public CartController(IProductRepository repo)
          {
              repository = repo;
          }
  
          public ViewResult Index(string returnUrl)
          {
              return View(new CartIndexViewModel
              {
                  Cart = GetCart(),
                  ReturnUrl = returnUrl
              });
          }
  
          public RedirectToRouteResult AddToCart(int productID, string returnUrl)
          {
              Product product = repository.Products.FirstOrDefault(p =&gt; p.ProductID == productID);
              if (product != null)
              {
                  GetCart().AddItem(product, 1);
              }
              return RedirectToAction("Index", new { url = returnUrl });
          }
  
          public RedirectToRouteResult RemoveFromCart(int productId, string returnUrl)
          {
              Product product = repository.Products.FirstOrDefault(p =&gt; p.ProductID == productId);
              if (product != null)
              {
                  GetCart().RemoveLine(product);
              }
              return RedirectToAction("Index", new { url = returnUrl });
          }
  
          private Cart GetCart()
          {
              Cart cart = (Cart)Session["Cart"];
              if (cart == null)
              {
                  cart = new Cart();
                  Session["Cart"] = cart;
              }
              return cart;
          }
  
      }
  }
  </code></pre>
  
  <p>ProductSummary View:</p>
  
  <pre><code>@model Domain.Entities.Product
  
  &lt;div class="item"&gt;
      &lt;h3&gt;@Model.Name&lt;/h3&gt;
      @Model.Description
       @using (Html.BeginForm("AddToCart", "Cart"))
      {
          @Html.HiddenFor(x =&gt; x.ProductID)
          @Html.Hidden("returnUrl", Request.Url.PathAndQuery)
          &lt;input type ="submit" value="+ Dodaj do koszyka"/&gt;
      }
      &lt;h4&gt;@Model.Price.ToString("c")&lt;/h4&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and CartIndexModelView:</p>
  
  <pre><code>public class CartIndexViewModel
  {
      public Cart Cart { get; set; }
      public string ReturnUrl { get; set; }
  }
  </code></pre>
  
  <p>And my problem is actually that my <code>&lt;a href="@Model.ReturnUrl"&gt;Kontynuuj zakupy&lt;/a&gt;</code>
  returns empty <code>&lt;a&gt;KontunuujZakupy&lt;/a&gt;</code> Html, which I guess means that <code>@Model.ReturnUrl</code> doesn't get any value at all. I couldn't figure out why because i am begginer, would You mind to give me a clue about that? Thanks.
  //edit
  "Kontynuuj zakupy" means Continue Shopping :)</p>