title: Getting errorJavaScript runtime error: Object doesn't support property or method 'jqGrid in MVC 3 using helpers
body: <p>I am trying to implement JqGrid in MVC3 using helpers, but all the time i get a javascript error -*<em>"JavaScript runtime error: Object doesn't support property or method 'jqGrid'".</em>*I also add reference of MVCJqgrid in my project.
  Here is my code for Jqgrid in view :-</p>
  
  <pre><code>@(Html.Grid(&amp;quot;AgentGrid&amp;quot;)
      .SetCaption(&amp;quot;Agents&amp;quot;)
  
      .AddColumn(new MvcJqGrid.Column(&amp;quot;AgentId&amp;quot;).SetLabel(&amp;quot;Agent SSN&amp;quot;))
          .AddColumn(new MvcJqGrid.Column(&amp;quot;Name&amp;quot;))
          .AddColumn(new MvcJqGrid.Column(&amp;quot;Country&amp;quot;))
          .AddColumn(new MvcJqGrid.Column(&amp;quot;City&amp;quot;))
          .AddColumn(new MvcJqGrid.Column(&amp;quot;Title&amp;quot;))
          .SetUrl(Url.Action(&amp;quot;List&amp;quot;, &amp;quot;Home&amp;quot;))
      .SetAutoWidth(true)
      .SetRowNum(10)
      .SetViewRecords(true)
      .SetPager(&amp;quot;pager&amp;quot;)
      )
  </code></pre>
  
  <p>and here is my code of action in controller:-</p>
  
  <pre><code> public ActionResult List(GridSettings gridSettings)
          {
              DataContext db = new DataContext();
  
              string Name = string.Empty;
              string Country = string.Empty;
              string City = string.Empty;
              string Title = string.Empty;
  
              if (gridSettings.IsSearch)
              {
                  Name = gridSettings.Where.rules.Any(r =&amp;gt; r.field == "Name") ?
                         gridSettings.Where.rules.FirstOrDefault(r =&amp;gt; r.field == "Name").data : string.Empty;
                  Country = gridSettings.Where.rules.Any(r =&amp;gt; r.field == "Country") ?
                  gridSettings.Where.rules.FirstOrDefault(r =&amp;gt; r.field == "Country").data : string.Empty;
                  City = gridSettings.Where.rules.Any(r =&amp;gt; r.field == "City") ?
                 gridSettings.Where.rules.FirstOrDefault(r =&amp;gt; r.field == "City").data : string.Empty;
                  Title = gridSettings.Where.rules.Any(r =&amp;gt; r.field == "Title") ?
                 gridSettings.Where.rules.FirstOrDefault(r =&amp;gt; r.field == "Title").data : string.Empty;
  
              }
  
              var Agents = db.Agent.ToList();
              int totalAgents = Agents.Count;
              var jsonData = new
              {
                  total = totalAgents / gridSettings.PageSize + 1,
                  page = gridSettings.PageIndex,
                  records = totalAgents,
                  rows = (
                          from c in Agents
                          select new
                          {
                              id = c.AgentId,
                              cell = new[]
                      { c.AgentId.ToString(),
                          string.Format("{0} {1}", c.Name, c.Country),
                          c.City,
                          c.Title
                      }
                          }).ToArray()
              };
  
              return Json(jsonData, JsonRequestBehavior.AllowGet);
          }
  </code></pre>
  
  <p>Please suggest me for resolve the issue !!
  Thanks in advance!!</p>