Articles : Page 1 of 1

  • Adding Export Capabilities to the Razor WebGrid

    Adding Export Capabilities to the Razor WebGrid

    Sep 11
    03

    When MVC first came out I really missed having a grid control. Now a few years later, we finally have a grid control again. In case, you didnt know the WebGrid was included in the System.Web.Helpers assembly which shipped with MVC 3. After using a variety of grid controls over the years I was actually glad that the API for the new WebGrid was kept clean and simple. Here is a screenshot of what the grid looks like: To display a grid on a razor view page, you basically create a new grid objec...


  • Changing Base Type Of A Razor View

    Changing Base Type Of A Razor View

    Feb 11
    21

    Within a Razor view, you have access to a base set of properties (such as Html, Url, Ajax, etc.) each of which provides methods you can use within the view. For example, in the following view, we use the Html property to access the TextBox method. @Html.TextBox("SomeProperty") Html is a property of type HtmlHelper and there are a large number of useful extension methods that hang off this type, such as  TextBox. But where did the Html property come from? It’s a property of System.We...



  • 1