Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
HtmlHelper does not contain a definition for BeginForm
posted

Good day all!!!

I'm getting the following errors with the code below. It is a aspx page that I'm trying to create with mvc.

  1. System.Web.Mvc.HtmlHelper<Claim.Models.user> does not contain a definition for Infragistics and no extension method Infragistics acception a first argument of type System.Web.Mvc.HtmlHelper<Claim.Models.user> could not be found.
  2. System.Web.Mvc.HtmlHelper<Claim.Models.user> does not contain a definition for LabelFor and no extension method LabelFor acception a first argument of type System.Web.Mvc.HtmlHelper<Claim.Models.user> could not be found.
  3. System.Web.Mvc.HtmlHelper<Claim.Models.user> does not contain a definition for BeginForm and no extension method BeginForm acception a first argument of type System.Web.Mvc.HtmlHelper<Claim.Models.user> could not be found.

What have I missed. If it's something stupid please don't laugh at the newbie :)...

<%--By defining the model type here, it is accessed in the View using the Model property--%>
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Claim.Models.user>" %>

<%--Reference the Infragistics ASP.NET MVC Helpers Assembly--%>
<%@ Import Namespace="Infragistics.Web.Mvc" %>

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ClaimCatch - RIS</title>
    <!-- These styles aren't required but provide better
    styling for labels on the running sample -->
    <style>
        BODY {
            font: 1em "Segoe UI",Helvetica,Tahoma,Arial,Verdana,sans-serif;
        }
        H2 {
            margin: 40px 0 0 0;   
        }
        H3 {
            margin: 10px 0 0 0;   
        }
    </style>

    <!-- Required JavaScript Files for using Infragistics jQuery UI-based
    widgets with the Infragistics Loader -->
    <script src="<%= Url.Content("~/Scripts/modernizr-2.5.3.js")%>"></script>
    <script src="<%= Url.Content("~/Scripts/jquery-1.7.1.js")%>"></script>
    <script src="<%= Url.Content("~/Scripts/jquery-ui-1.8.20.js")%>"></script>

    <!-- This script reference is require by the Infragistics Loader rendered below -->
    <script src="<%= Url.Content("~/Infragistics/js/infragistics.loader.js")%>"></script>
</head>
<body>

    <!-- The Infragistics Loader is used to load required Infragistics JavaScript
    and CSS resources on the rendered page. Using ths helper, it is required to
    supply the loader with a path to the Infragistics JavaScript files and a path to
    the CSS files.
    
    The loader dynamically determines which required scripts and CSS
    must be referenced based off of the Infragistics components used in this View.
    The loader itself requires one JavaScript reference defined above. -->
    <%= Html.Infragistics().Loader()
        .ScriptPath(Url.Content("~/Infragistics/js/"))
        .CssPath(Url.Content("~/Infragistics/css/"))
        .Render()
     %>

    <!-- All of the Infragistics ASP.NET MVC helpers use a chaining
    API pattern. The helpers require that Render() be the last method
    called. This method renders all of the HTML and JavaScript for
    the jQuery UI widget on the page-->

  <% using (Html.BeginForm()) %>
    <% { %>
        <p>
            <%= Html.LabelFor(m => m.User_UserName) %>
            <%= Html.Infragistics()
                .TextEditorFor(m => m.User_UserName)
                .Render() %>
        </p>
        <p>
            <%= Html.LabelFor(m => m.User_Password) %>
            <%= Html.Infragistics()
                .NumericEditorFor(m => m.User_Password)
                .Render() %>
        </p>
        <p>
            <input type="submit" value="Create" />
        </p>
    <% } %>

</body>
</html>