Copied to clipboard

Flag this post as spam?

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


  • Deependra 6 posts 36 karma points
    Feb 16, 2013 @ 19:19
    Deependra
    0

    Setting up MVC website

    Hi Everyone,   Could any one please help me out in starting with setting up MVC website in Umbraco?  I gone through several links but none of them explains how to start , please help?

     

     

  • Anthony Candaele 1197 posts 2049 karma points
    Feb 16, 2013 @ 19:45
    Anthony Candaele
    0

    Hi Deependra,

    The  Standard Website MVC starterkit is a good starting point.

    Hope this helps,

    Anthony

  • Deependra 6 posts 36 karma points
    Feb 16, 2013 @ 21:07
    Deependra
    0

    Thanks Anthony for quick reply. There is no instruction given on website how to use this Standard Website MVC kit.

    Could you please explain how to setup this?

  • Charles Afford 1163 posts 1709 karma points
    Feb 16, 2013 @ 23:37
    Charles Afford
    0

    Hi Deep.  What i did was to create a umbraco site in inetpub.  Create a class project in visual studio, which built the dlls to the bin of the inetpub project.  

     

    You should read this: http://umbraco.com/follow-us/blog-archive/2012/10/30/getting-started-with-mvc-in-umbraco-410.aspx

    and this:  http://our.umbraco.org/documentation/reference/mvc/

    If you need any help give us a shout :).  I would advise using surface controllers :).  Charlie

  • Anthony Candaele 1197 posts 2049 karma points
    Feb 17, 2013 @ 08:27
    Anthony Candaele
    1

    Hi Deependra,

    It's a package. Just install a blank (no starterkit and theme) Umbraco installation. If you have set up the blank Umbraco installation, then install the Standard Website MVC starterkit.

    You can install a package via the Umbraco Backend in the Developer Section > Packages > Local Packages.

    Hope this helps,

    Anthony

  • Charles Afford 1163 posts 1709 karma points
    Feb 21, 2013 @ 11:21
    Charles Afford
    1

    Yea i would agree with Anthony, using the starter kit is the better way to start things off :)

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 21, 2013 @ 12:33
    Jeroen Breuer
    101

    There is also a complete Umbraco MVC website which just runs out of the box: http://24days.in/umbraco/2012/damp-gallery/

    Jeroen

  • Deependra 6 posts 36 karma points
    Feb 21, 2013 @ 20:46
    Deependra
    0

    Thanks All, I got it runing .

  • All Blonde 86 posts 138 karma points
    Feb 25, 2013 @ 17:35
    All Blonde
    0

    Hey guys, followed your advize and setup STandard MVC site on my Umbraco 6 installation.

    Getting lot of error like


    Compiler Error Message: CS1502: The best overloaded method match for 'string.IsNullOrEmpty(string)' has some invalid arguments

    Source Error:

     
    Line 8:            foreach(var nodeId in nodeIds)
    Line 9:             {
    Line 10: if(!String.IsNullOrEmpty(nodeId)) Line 11:                {
    Line 12:                    var publishedContent = Umbraco.NiceUrl(Convert.ToInt32(nodeId));

    Source File: e:\UMBRACO\Umbraco6-test.tmp-cms.com\Views\Partials\ContentPanels.cshtml    Line: 10


    or:

     


    Compiler Error Message: CS1061: 'object' does not contain a definition for 'Split' and no extension method 'Split' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

    Source Error:

     
    Line 33:                 {
    Line 34:                     <ul  class="navigation fc">
    Line 35: @foreach (var item in Umbraco.TypedContent(homepage.GetPropertyValue("headerNavigation").Split(','))) Line 36:                     {
    Line 37:                         <li><a href="@item.NiceUrl()">@item.Name</a></li>


    Source File: e:\UMBRACO\Umbraco6-test.tmp-cms.com\Views\SW_Master.cshtml    Line: 35

     

    And so far each time I am compensating one error - getting next one.

    Any ideas what could be wrong if you have it up and running?

    Thanks

    Umbraco 6, Windows Server 2003 with NET 4.0 installed. Config changes for MVC to be default done.

    What else?

    Thanks

     

  • Stan 2 posts 22 karma points
    Jul 24, 2014 @ 15:32
    Stan
    0

    Hi, 

    You should try installing Ucomponents. I have noticed that the Standard Website uses a SW page picker, which is not working without Ucomponents and causes errors on some pages.

     

    Hope that helps

    EDIT: There is one fix you should make to the ContentPanels.cshtml partial view. At the moment it will throw an exception if no content panels are found on the page because it tries to split a 'null' element. Just replace the first code block on the cshtml file with:

    @{
        Layout = null;
        List<IPublishedContent> panels = new List<IPublishedContent>();
    
        var contentPannels = Model.GetPropertyValue<string>("contentPanels");
        if (contentPannels != null)
        {
            var nodeIds = Model.GetPropertyValue<string>("contentPanels").Split(',');
    
            foreach (var nodeId in nodeIds)
            {
                if (!String.IsNullOrEmpty(nodeId))
                {
                    var publishedContent = Umbraco.NiceUrl(Convert.ToInt32(nodeId));
                    if (!String.IsNullOrEmpty(publishedContent) && publishedContent != "#")
                    {
                        panels.Add(Umbraco.TypedContent(nodeId));
                    }
                }
            }
        }
    }
Please Sign in or register to post replies

Write your reply to:

Draft