Copied to clipboard

Flag this post as spam?

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


  • Aximili 177 posts 278 karma points
    Sep 05, 2011 @ 05:57
    Aximili
    0

    Links are broken if run from Visual Studio (http://localhost:3683/MyWebsite/)

    Does anyone know how to fix this problem?

    I even tried downloading the source (4.7.1) and put the fix in this function

            public string EnsureMasterPageSyntax(string masterPageContent)
    {
    replaceElement(ref masterPageContent, "?UMBRACO_GETITEM", "umbraco:Item", true);
    replaceElement(ref masterPageContent, "?UMBRACO_GETITEM", "umbraco:Item", false);

    // Parse the design for macros
    replaceElement(ref masterPageContent, "?UMBRACO_MACRO", "umbraco:Macro", true);
    replaceElement(ref masterPageContent, "?UMBRACO_MACRO", "umbraco:Macro", false);

    // Parse the design for load childs
    masterPageContent = masterPageContent.Replace("<?UMBRACO_TEMPLATE_LOAD_CHILD/>", getAspNetMasterPageContentContainer()).Replace("<?UMBRACO_TEMPLATE_LOAD_CHILD />", getAspNetMasterPageContentContainer());
    // Parse the design for aspnet forms
    getAspNetMasterPageForm(ref masterPageContent);
    masterPageContent = masterPageContent.Replace("</?ASPNET_FORM>", "</form>");
    // Parse the design for aspnet heads
    masterPageContent = masterPageContent.Replace("</ASPNET_HEAD>", String.Format("<head id=\"{0}Head\" runat=\"server\">", Alias.Replace(" ", "")));
    masterPageContent = masterPageContent.Replace("</?ASPNET_HEAD>", "</head>");

    // This is my fix attempt, it doesn't work
    string appPath = HttpContext.Current.Request.ApplicationPath;
    appPath = appPath.EndsWith("/") ? appPath : appPath + "/";
    masterPageContent = masterPageContent.Replace("src=\"/", "src=\"" + appPath).Replace("href=\"/", "href=\"" + appPath);

    return masterPageContent;
    }

    and rebuild it and copy the dlls into my website, but nothing changed. (I don't really know what I am doing here)

    Anyone else experiencing this problem or know the solution?

    Thanks in advance.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 05, 2011 @ 13:32
    Matt Brailsford
    0

    Hi Hardi,

    I think the probelm is that you are running the site from a Virtual Directory. It is possible to configure Umbraco to run from a VD, but it's probably much more straight forward and easier to setup if you just run it as a root website. You can just setup a site in IIS, and point it to the folder containing the web file and run it that way.

    Cheers

    Matt

  • Aximili 177 posts 278 karma points
    Sep 06, 2011 @ 02:05
    Aximili
    0

    Yeah I could also do that, thanks Matt :)

Please Sign in or register to post replies

Write your reply to:

Draft