Copied to clipboard

Flag this post as spam?

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


  • Ben Divsalar 14 posts 34 karma points
    Oct 03, 2012 @ 10:01
    Ben Divsalar
    0

    Problem with RenderTemplate

    I have uComponent 2.1 under Umbraco 4.5.2. I am getting error on the list of RenderTemplate in below xlst.

    TemplateId 1319 has only a simple word test on it.

    <xsl:output method="html" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:variable name="InsertFormTemplateId"  select="1319"/> 
    <xsl:variable name="formGUID" select="/macro/formGUID" />    

    <xsl:template match="/">
      <xsl:apply-templates select="$currentPage" mode="insertForm" />
    </xsl:template>
        
    <xsl:template match="*" mode="insertForm">
     <xsl:if test="$formGUID!= ''">
       <div style="display:none"><xsl:value-of select="'setting session...'" /></div>
       <xsl:variable name="setSession" select="umbraco.library:setSession('formGUID', $formGUID)" />
       <div style="display:none"><xsl:value-of select="'writing template...'" /> /></div>
        <xsl:value-of select="umbraco.library:RenderTemplate(@id, $InsertFormTemplateId")" disable-output-escaping="yes"/>
       <div style="display:none"><xsl:value-of select="'clearing session...'" /></div>
       <xsl:variable name="clearSession" select="umbraco.library:setSession('formGUID', '')" />
      </xsl:if>
    </xsl:template>

     

    This is the error I am getting. 

     

    <!-- Error generating macroContent: 'System.InvalidOperationException: Failed to map the path '/default.aspx'.
       at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull)
       at System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath)
       at System.Web.VirtualPath.MapPathInternal()
       at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
       at System.Web.HttpRequest.MapPath(VirtualPath virtualPath)
       at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
       at System.Web.HttpServerUtility.Execute(String path, TextWriter writer)
       at umbraco.library.RenderTemplate(Int32 PageId, Int32 TemplateId)' -->
  • Ben Divsalar 14 posts 34 karma points
    Oct 03, 2012 @ 10:47
    Ben Divsalar
    0

    Please note that this happens only in localhost and not in dev/live where they are setup exactly the same unless I am missing something?

  • Ben Divsalar 14 posts 34 karma points
    Oct 03, 2012 @ 16:03
    Ben Divsalar
    0

    Just to give you more info, I have copied the whole umbraco from Dev machine (working RenderTemplate) into my local including database etc, the renderTemplate still is NOT working. I have exactly same umbraco in two different machines (dev & local) renderTemplate is fine in Dev and NOT in local.

    Please could someone help me to get rid of this issue. I need to debug locally some of out user controls and this doesn't let me to do.

    PLEASE PLEASE PLEASE Help.

     

    The error message is now different. here is the errors:

    System.Web.HttpException (0x80004005): The file '/default.aspx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtility.Execute(String path, TextWriter writer) at umbraco.library.RenderTemplate(Int32 PageId, Int32 TemplateId)'

  • Ben Divsalar 14 posts 34 karma points
    Oct 03, 2012 @ 17:31
    Ben Divsalar
    0

    I found the issue and managed to have a working renderTemplate. I was using my local Win XP IIS initially and had a virtual directory pointing to umbraco development forder and it was NOT working. it seems renderTemplate looks for a default.aspx page in the root folder rather than the umbraco. Anyway, all I did to fix this issue was using WebMatrix to run the umbraco instead of IIS. All I did was adding a new site in WebMatrix and pointing it the same folder and RenderTemplate is now happy.

    Can anyone explain what was the issue and how WebMatrix is different from IIS?

    I want to know how I can debug my usercontrol using Visual Studio while it's running under WebMatrix. I like to put break point into visual studio and see what's going on in the user control. Please help me on this.

Please Sign in or register to post replies

Write your reply to:

Draft