title: Problem displaying a webgrid in MVC pertial view
body: <p>I already a have a view. Now I have to add a new web grid in that view.
  To do this, I have create a partial view and trying to bind a webgrid in the partial with no success. :(</p>
  
  <p>This is my controller:</p>
  
  <pre><code>public ActionResult RegisteredUsers()
      {
          var query = from p in dc.UserProfile
                      select new RegisterModel()
                      {
                          UserName = p.Name
                      };
  
          List&lt;RegisterModel&gt; users = query.ToList();
  
          return View(users);
      }
  </code></pre>
  
  <p>This is my partial view:</p>
  
  <pre><code>&lt;%
      var grid = new WebGrid(Model,rowsPerPage:5);
      %&gt;
      &lt;%: 
         grid.GetHtml(
                      tableStyle: "wGrid",
                      headerStyle: "wGridHeader",
                      alternatingRowStyle: "alt",
                      footerStyle: "wGridFooter",
                      columns: grid.Columns(
  
                      grid.Column("UserName","User name")
  
                    )
                 )
      %&gt;
  </code></pre>
  
  <p>BUT, it shows an error in the webgrid in my partial view. the error is :
  <b>A data source must be bound before this operation can be performed.</b></p>
  
  <p>The error is self explanatory. But the 'Model' in the line "var grid = new WebGrid(Model,rowsPerPage:5);" is the datasource. Isn't it??
  Guys any idea how to solve this??</p>