Copied to clipboard

Flag this post as spam?

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


  • yumin 51 posts 243 karma points
    Jan 09, 2014 @ 12:50
    yumin
    0

    why can not import namespace in partial views

    umbraco ver is 7.0.2, this is my code:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @System.Web.Mvc;
    
    @MvcHtmlString.Create("<ul>")
    

    it will get a error

    'System.Web.Mvc' is a 'namespace', which is not valid in the given context

    but change to this is correct

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage  
        @System.Web.Mvc.MvcHtmlString.Create("<ul>")
    

    how can i import namespace in partial views?

    thanks very much

  • Mike Chambers 635 posts 1252 karma points c-trib
    Jan 09, 2014 @ 13:21
    Mike Chambers
    100

    @using System.Web.Mvc ??

  • yumin 51 posts 243 karma points
    Jan 10, 2014 @ 02:08
    yumin
    0

    oh, my god, I made ​​a stupid mistake

    thanks mike

Please Sign in or register to post replies

Write your reply to:

Draft