Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Rowe 9 posts 109 karma points
    Feb 18, 2016 @ 17:49
    Mike Rowe
    0

    The type or namespace name 'MyFirstForm' could not be found

    I'm new to Umbraco and all associated technologies. It is for that reason, I find the tutorials very valuable. I have followed the instructions in the tutorial in Documentation=>Getting Started=> Code =>Creating Forms, very carefully.

    I have a document called "Generic" that uses the view (GenericContactForm.cshtml) that loads the Partial View:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    

    @{ Layout = null; } @using MyFirstForm.Models;

    @{ Html.RenderPartial("~/Views/Partials/ContactForm.cshtml", new ContactFormViewModel()); }

    However, in spite of meticulously following these directions, I get the following error when calling http://localhost/generic:

    Server Error in '/' Application.

    Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0246: The type or namespace name 'MyFirstForm' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 3: Layout = null; Line 4: } Line 5: @using MyFirstForm.Models; Line 6:
    Line 7: @{

    Source File: c:\ESC_Test\ESCProject\Views\GenericContactForm.cshtml Line: 5

    Thanks in advance for any help to solve this. Once corrected, I will suggest an update to the otherwise great tutorial if appropriate.

    Thank you

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies