Developer forum

Forum » Templates » DW8: Title doens't show and @DwTemplateTags not working

DW8: Title doens't show and @DwTemplateTags not working

Jop Reuvers
Reply
 We've just started with our first DW8 solution and are running into a strange problem. We've created a masterpage and a pagetemplate,everything on this page works and displays the way it should except for the Title. I've put the client name in the Title tags on the masterpage but the site shows Dynamicweb 8 as the title.

Another strange thing is that the <!--@DwTemplateTags-->  tag is not rendering. It disappears complety in the source code. So it doesn't even display the unrendered tag, just a blank line.



Masterpage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" itemscope itemtype="http://schema.org/Product">
<head>
	<title>Client name</title>
	 <!--@Include(includes/Credentials.htm)--> 
	 <!--@Include(includes/HeadSection.htm)-->     
</head>
<body>
    <!--@DwTemplateTags-->
Output:
<head>
	<title>Dynamicweb 8</title>
        All the css and script files are here
</head>
<body>    
blank space


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi Jop,

Is this a custom solution you upgraded, or is this a standard DW 8 solution? In the former case, you need to update your Default.aspx, Global.asax and Web.config. Check out the templates for Visual Studio in the Downloads section for the files, or use those from the standard solution.

Cheers,

Imar
 
Jop Reuvers
Reply
 
Hi Imar,

We did upgrade a solution, without any custom code. We've already updated the Default.aspx, Global.asax and Web.config.

Default.aspx
<%@ Page Language="vb" AutoEventWireup="false" ValidateRequest="false" CodeBehind="Default.aspx.vb" Inherits="Website_2012._Default" %>
<asp:placeholder id="Output" runat="server" />




Global.asax
<%@ Application Codebehind="Global.asax.vb" Inherits="Website_2012.Global_asax" %>



Web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <!-- application specific settings -->
  <appSettings>
    <!--  HttpCompressionSettings
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        ' Folder / Files where http compression is disabled.
        '
        ' Paths are checked from left to right.
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
		<add key="HttpCompressionSettings" value="/Admin/Public,Admin/Access" />
		<add key="HttpCompressionpreferredAlgorithm" value="deflate|gzip" />
		<add key="HttpCompressionLevel" value="high|normal|low" />
		-->
    <add key="HttpCompressionSettings" value="/Admin/Public,/Admin/Statisticsv2,/Admin/FileManager,/Admin/Module/Ecom/,/Admin/Module/Ipaper,/Admin/Module/News/News_Module_List.aspx,/WebResource.axd" />
    <add key="HttpCompressionForceSettings" value="/Admin/Public/eCom/InstantSearch.ashx" />
    <add key="HttpCompressionPreferredAlgorithm" value="deflate" />
    <add key="HttpCompressionLevel" value="low" />
    <add key="GeoLocationServiceToken" value="TJMqI2937C" />    
    <!-- O ntwikkel / A cceptatie / P roductie -->
    <add key="DomainFase" value="O"/>
    <!-- Google Analytics Configuration-->
    <add key="GAKey_nl-NL" value="UA-xxxxxx-1"/>
    <!-- Add Reviews Section-->
    <add key="Paragraph_ReviewAddedThankYou" value=""/>
    <!-- General shop information-->
    <add key="GoogleMapsKey" value=""/>
    <add key="GoogleMapsKey_Staging" value=""/>
    <add key="KlantNaam" value="clientname"/>
    <add key="MailFrom" value="info@clientname.nl"/>
    <add key="MailRecipient" value="mail@receipient.com"/>
    <add key="CustomTranslationsXML" value="http://clientname.dev/Files/Templates/Translations.xml"/>
    <add key="RootFolder" value="C:\Projects\clientname\Website 2012\Website 2012\"/>
  </appSettings>
  <connectionStrings>
    <add name="Connectionstring" connectionString="Data Source=dbserverip;Initial Catalog=dbname;Persist Security Info=True;User ID=dbusername;Password=password" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="mail@receipient.com">
        <network host="mail@receipient.com"/>
      </smtp>
    </mailSettings>
  </system.net>
  <system.web>
    <!--  DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to insert debugging symbols (.pdb information)
          into the compiled page. Because this creates a larger file that executes
          more slowly, you should set this value to true only when debugging and to
          false at all other times. For more information, refer to the documentation about
          debugging ASP.NET files.
		  
    -->    
    <compilation defaultLanguage="vb" debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
      <expressionBuilders>
        <add expressionPrefix="GS" type="Dynamicweb.Controls.Design.GlobalSettingsExpressionBuilder, Dynamicweb.Controls" />
      </expressionBuilders>
    </compilation>
    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. 
          Add <error> tags for each of the errors you want to handle.

          "On" Always display custom (friendly) messages.
          "Off" Always display detailed ASP.NET error information.
          "RemoteOnly" Display custom (friendly) messages only to users not running 
           on the local Web server. This setting is recommended for security purposes, so 
           that you do not display application detail information to remote clients.
    -->
    <customErrors mode="Off" />
    <!--  AUTHENTICATION 
          This section sets the authentication policies of the application. Possible modes are "Windows", 
          "Forms", "Passport" and "None"

          "None" No authentication is performed. 
          "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to 
           its settings for the application. Anonymous access must be disabled in IIS. 
          "Forms" You provide a custom form (Web page) for users to enter their credentials, and then 
           you authenticate them in your application. A user credential token is stored in a cookie.
          "Passport" Authentication is performed via a centralized authentication service provided
           by Microsoft that offers a single logon and core profile services for member sites.
    -->
    <authentication mode="Windows" />
    <!--  AUTHORIZATION 
          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous 
          (unauthenticated) users.
    -->
    <authorization>
      <allow users="*" />
      <!-- Allow all users -->
      <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>
    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every page within an application. 
          Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
          trace information will be displayed at the bottom of each page.  Otherwise, you can view the 
          application trace log by browsing the "trace.axd" page from your web application
          root. 
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests belong to a particular session. 
          If cookies are not available, a session can be tracked by adding a session identifier to the URL. 
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
    <httpRuntime executionTimeout="600" maxRequestLength="512000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true" requestValidationMode="2.0" requestPathInvalidCharacters="&lt;,>,*,%,:,\,?" />
    <!--  GLOBALIZATION
          This section sets the globalization settings of the application. 
    -->
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
    <httpModules>
      <add type="HttpCompression.HttpCompressionModule,HttpCompression" name="HttpCompression" />
    </httpModules>
    <httpHandlers>
      <add verb="*" path="globalsettings.aspx" type="System.Web.HttpForbiddenHandler" />
      <add verb="*" path="globalsettings.xml.aspx" type="System.Web.HttpForbiddenHandler" />
      <add verb="*" path="ecom.xml.aspx" type="System.Web.HttpForbiddenHandler" />
      <add verb="*" path="updates.xml.aspx" type="System.Web.HttpForbiddenHandler" />
    </httpHandlers>
    <xhtmlConformance mode="Transitional" />
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" validateRequest="false" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2048000000" />
      </requestFiltering>
    </security>
    <handlers>
      <add name="globalsettings.xml.aspx_*" path="globalsettings.xml.aspx" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="Globalsettings.aspx_*" path="globalsettings.aspx" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="ecom.xml.aspx_*" path="ecom.xml.aspx" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="updates.xml.aspx_*" path="updates.xml.aspx" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <add name="_sys_crm_report_xml.aspx_*" path="_sys_crm_report_xml.aspx" verb="*" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
    <modules>
      <add name="HttpCompression" type="HttpCompression.HttpCompressionModule,HttpCompression" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
    <tracing>
      <traceFailedRequests>
        <add path="*">
          <traceAreas>
            <add provider="ASP" verbosity="Verbose" />
            <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
            <add provider="ISAPI Extension" verbosity="Verbose" />
            <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI" verbosity="Verbose" />
          </traceAreas>
          <failureDefinitions statusCodes="500" />
        </add>
      </traceFailedRequests>
    </tracing>
  </system.webServer>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IIPLookupService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="Endpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
                  receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                  bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                  maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                  messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                  useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_IAdIntelligenceService" closeTimeout="00:01:00"
               openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
               allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
               maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
               messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
               useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BingPortBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
            receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
            bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>

      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://geolocation.dynamicweb-cms.com/IPLookup/IPLookupService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IIPLookupService" contract="dk.dynamicweb.geolocation.IIPLookupService" name="BasicHttpBinding_IIPLookupService" />
      <endpoint address="https://epayment.bbs.no/Netaxept.svc" binding="basicHttpBinding"  bindingConfiguration="Endpoint" contract="no.bbs.epayment.INetaxept" name="Endpoint" />
      <endpoint address="https://epayment-test.bbs.no/Netaxept.svc" binding="basicHttpBinding" bindingConfiguration="Endpoint" contract="no.bbs.epayment.test.INetaxept" name="Endpoint" />
      <endpoint address="https://adcenterapi.microsoft.com/Api/Advertiser/V8/CampaignManagement/AdIntelligenceService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAdIntelligenceService"
            contract="BingSuggestionAPIwebSrv.IAdIntelligenceService"
            name="BasicHttpBinding_IAdIntelligenceService" />
      <endpoint address="http://api.bing.net:80/soap.asmx" binding="basicHttpBinding"
                  bindingConfiguration="BingPortBinding" contract="net.bing.api.BingPortType"
                  name="BingPort" />
    </client>
  </system.serviceModel>
</configuration>


 
Pavel Volgarev
Reply
 Hi Jop,

Can we have a URL to a website? We actually have an open investigation item regarding DwTemplateTags not being rendered so having a URL to a page where it's reproducible will definitely help us identify the issue.

-- Pavel
 
Jop Reuvers
Reply
Here you go: http://suurmond.staging2.innovadis.com
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi Jop,

Can you also post the Code Behind for Global.asax.vb and Default.vb?

Imar




 
Jop Reuvers
Reply
 Imar,

Here is the code behind for the files you've requested.

Global.asax.vb
Imports System.Web.SessionState

Public Class Global_asax
    Inherits System.Web.HttpApplication
    'Dim GlobalAsax As Dynamicweb.Frontend.GlobalAsaxHandler

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
		' Fires when the application is started
        Dynamicweb.Frontend.GlobalAsaxHandler.Application_Start(sender, e)
    End Sub

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
		' Fires when the session is started
        Dynamicweb.Frontend.GlobalAsaxHandler.Session_Start(sender, e)
	End Sub

	Sub Application_OnPreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
        Dynamicweb.Frontend.GlobalAsaxHandler.Application_OnPreRequestHandlerExecute(sender, e)
	End Sub

	Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
		' Fires at the beginning of each request
		'GlobalAsax.Application_BeginRequest(sender, e)
	End Sub

    Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
		' Fires upon attempting to authenticate the use
        Dynamicweb.Frontend.GlobalAsaxHandler.Application_AuthenticateRequest(sender, e)
    End Sub

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
		' Fires when an error occurs
        Dynamicweb.Frontend.GlobalAsaxHandler.Application_Error(sender, e)
    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
		' Fires when the session ends
        Dynamicweb.Frontend.GlobalAsaxHandler.Session_End(sender, e)
    End Sub

    Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
		' Fires when the application ends
        Dynamicweb.Frontend.GlobalAsaxHandler.Application_End(sender, e)
	End Sub
End Class


Default.vb
Imports System
Imports System.Xml
Imports Dynamicweb
Imports Dynamicweb.Frontend
Partial Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'Initiate the pageview object that handles a Page view in Dynamicweb
        Dim Pageview As New Dynamicweb.Frontend.PageView()

        'Load data, templates and settings in the pageview object
        Pageview.Load()

        'Render the data of the pageview object and place the resulting HTML in the output-literal
        Dim pvCtrl As New Dynamicweb.Frontend.PageviewControl
        Output.Controls.Add(pvCtrl)
        pvCtrl.Pageview = Pageview
        pvCtrl.ParseControls()

    End Sub
End Class

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer
Hi Jop,

This is indeed Pre-8 code. In Default.aspx.vb in Page_Load, all you need is this:

Output.Controls.Add(New PageviewControl())

Check out the Visual Studio templates for Dynamicweb (use the 1.6 beta which is pretty much final) and take a look here:  http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-default.aspx--global.asax-and-web.config-changes.aspx

Hope this helps,

Imar

Votes for this answer: 0
 
Jop Reuvers
Reply
Imar,

This has solved our problem, also the Template tags are being rendered now. 

This is why this problem has occurred:
- We've created a DW7 solution using a clean setup. The clean setup contained the files: Default.aspx.designer.vb, default.aspx.vb and global.asax.vb
- After that we've converted the DW7 solution to DW8 using the files on the engage download page. These files didn't contain the files listed above, so they weren't overwritten when we copied the files into our solution.

Thank you for your support!


 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi Jop,

Yes, that's correct. The Code Behind files are not part of the official application. For new, custom, solutions you need to use the VS templates.

Cheers,

Imar

 

You must be logged in to post in the forum