title: HtmlHelpers for managing scripts for Razor Partial Views
body: <p>I'm trying to use <a href="http://www.nuget.org/packages/Forloop.HtmlHelpers/" rel="nofollow">Forloop HtmlHelpers</a> for managing scripts for Razor Partial Views in my ASP.Net MVC 4 project.</p>
  
  <pre><code> &lt;div class="row-fluid"&gt;
    //some markups here
   &lt;/div&gt;
  
   @{
    // begin a context for the scripts
     Html.BeginScriptContext();
  
     Html.AddScriptBlock(@"$(function() { alert('hello from the page'); } });");
     Html.AddScriptFile("~/Scripts/jquery-ui-1.8.11.js");
  
     // end the script context
     Html.EndScriptContext();
     }
  </code></pre>
  
  <p>But, it's throwing the following error during compile -</p>
  
  <blockquote>
    <p>'System.Web.Mvc.HtmlHelper' does not contain a definition for
    'BeginScriptContext' and no extension method 'BeginScriptContext'
    accepting a first argument of type
    'System.Web.Mvc.HtmlHelper' could be found (are you missing a
    using directive or an assembly reference?)    </p>
  </blockquote>
  
  <p>I've installed this package via package manager console.
  How to overcome this issue?</p>
  
  <p>Thank you.</p>