title: ASP.NET MVC: How to show value in a label from selected Drop Down List item?
body: <p>I'm trying to show a value of selected Drop Down List item in a label. I managed to make this work with Web Forms but with MVC I'm totally lost. My Index looks like this:</p>
  
  <pre><code>[...] 
     &lt;% using (Html.BeginForm()) { %&gt;
         &lt;table&gt;
            &lt;tr&gt;
               &lt;td&gt;Processor&lt;/td&gt;
               &lt;td&gt;&lt;%= Html.DropDownList("lstProcessor1", new SelectList((IEnumerable)ViewData["Processor1List"], "product_price", "product_description")) %&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
               &lt;td&gt;Total Amount&lt;/td&gt;
               &lt;td&gt;0,00 €&lt;/td&gt;
            &lt;/tr&gt;
           &lt;/table&gt;
        &lt;input type="submit" value="Submit" /&gt;
     &lt;% } %&gt;
      [...]
  </code></pre>
  
  <p>And my HomeController starts with:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using System.Web.Mvc.Ajax;
  using MvcApplication1.Models;
  
  namespace MvcApplication1.Controllers
  {
      [HandleError]
      public class HomeController : Controller
      {
          // Connect database
          DB50DataContext _ctx = new DB50DataContext();
  
          // GET: /Home/
          public ActionResult Index()
          {
              // Search: Processors
              var products = from prod in _ctx.products
                             where prod.product_searchcode == "processor1"
                             select prod;
  
              ViewData["Processort1List"] = products;
  
              return View();
          }
  </code></pre>
  
  <p>I would like the product_price to show on the second line of the table, where it now says 0,00 €. It should also update the price automatically when the item from the Drop Down List is changed. </p>
  
  <p>I guess I should use JQuery but I have no idea how. Could someone please give me some tips how to do this?</p>