title: MVC - Passing Parameters from View to Popup
body: <p>I'm having a problem passing parameters from my view to my popup.</p>
  
  <p>In my view, I have the following razor code to render an Action Link wherein when I click it, a pop-up will appear:</p>
  
  <pre><code>@Html.ActionLink("[Edit Product]", "Edit", "Products", new { ProductCode = @Model.ProductCode}, new { @class = "editLink" })
  </code></pre>
  
  <p>I'm not quite sure if this is correct or if the part <code>new { ProductCode = @Model.ProductCode}</code> makes any sense (please explain to me what that part does, anybody hihi).</p>
  
  <p>Anyway, my pop-up code accepts a parameter like this:</p>
  
  <p><code>@model MySuperStore.Models.ViewModel.ProductsModel</code></p>
  
  <p>Whenever I try to display the ProductCode via <code>@Mode.ProductCode</code>, I always receive an error saying the reference not set to an instance of an object.</p>
  
  <p>I have tried placing the ProductCode in a <code>ViewData</code> through the MainView and accessing it on the pop-up but that doesn't seem to work either.</p>
  
  <p>Can somebody please help me? Thanks. Cheers!</p>