Have you read this blog post including the comments? Also, you say CMS 6.0 and PTB 2, are you sure about 6.0? PTB 2 requires 6 R2 so that may be the cause.
Sorry, the CMS version is 6.1.379.0 and PTB is 2.0.0.0.
Should be any problems between both that cause the error?
That combination should work fine. Unless you're experience the problem(s) described in the blog post + comments I don't know why this is happening. If so, could you provide more context? Such as: part of the source for the page type class, part of the source for the template, request URL and any information about any modifications that have been made to the URL rewriting on the site.
Thanks again. I attach some lines that can help better to understand this issue.
I added the code lines in Global.asax as it told in the blog but it didn't work.
here goes, DefaultPageType.cs
namespace Point.Cms.EPiSrvr.PageTypeBuilder.Pages {
[PageType(AvailableInEditMode = false)]
public abstract class DefaultPageType : BasePageType, IHasTargetDisplay {
[PageTypeProperty(EditCaption = "Heading",
HelpText = "",
SortOrder = 10,
UniqueValuePerLanguage = true,
Required = false,
Searchable = true,
Tab = typeof(InformationTab),
Type = typeof(PropertyString))]
public virtual string Heading { get; set; }
[PageTypeProperty(EditCaption = "Sub heading",
HelpText = "",
SortOrder = 20,
UniqueValuePerLanguage = true,
Required = false,
Searchable = true,
Tab = typeof(InformationTab),
Type = typeof(PropertyString))]
public virtual string SubHeading { get; set; }
[PageTypeProperty(EditCaption = "Browser title",
HelpText = "",
SortOrder = 30,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(InformationTab),
Type = typeof(PropertyString))]
public virtual string BrowserTitle { get; set; }
[PageTypeProperty(EditCaption = "Url to image",
HelpText = "",
SortOrder = 40,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(InformationTab),
Type = typeof(PropertyDocumentUrl))]
public virtual string Image { get; set; }
public virtual string ImageAlignment { get; set; }
[PageTypeProperty(EditCaption = "Image text",
HelpText = "",
SortOrder = 50,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(InformationTab),
Type = typeof(PropertyString))]
public virtual string ImageText { get; set; }
[PageTypeProperty(EditCaption = "Preamble",
HelpText = "",
SortOrder = 60,
UniqueValuePerLanguage = true,
Required = false,
Searchable = true,
Tab = typeof(InformationTab),
Type = typeof(PropertyLongString))]
public virtual string Preamble { get; set; }
[PageTypeProperty(EditCaption = "Main body",
HelpText = "",
SortOrder = 70,
UniqueValuePerLanguage = true,
Required = false,
Searchable = true,
Tab = typeof(InformationTab),
Type = typeof(PropertyXhtmlString))]
public virtual string MainBody { get; set; }
[PageTypeProperty(EditCaption = "Meta keywords",
HelpText = "",
SortOrder = 80,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(MetaDataTab),
Type = typeof(PropertyString))]
public virtual string MetaKeywords { get; set; }
[PageTypeProperty(EditCaption = "Meta description",
HelpText = "",
SortOrder = 90,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(MetaDataTab),
Type = typeof(PropertyString))]
public virtual string MetaDescription { get; set; }
[PageTypeProperty(EditCaption = "Meta author",
HelpText = "",
SortOrder = 100,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(MetaDataTab),
Type = typeof(PropertyString))]
public virtual string MetaAuthor { get; set; }
[PageTypeProperty(EditCaption = "Portlet manager",
HelpText = "",
SortOrder = 110,
UniqueValuePerLanguage = false,
Required = false,
Searchable = false,
Tab = typeof(PortletManagementTab),
Type = typeof(PropertyPortletManager))]
public virtual string PortletManager { get; set; }
[PageTypeProperty(EditCaption = "FeedSource1",
HelpText = "",
SortOrder = 300,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(FeedsTab),
Type = typeof(PropertyPageReference))]
public virtual string FeedSource1 { get; set; }
[PageTypeProperty(EditCaption = "FeedSource2",
HelpText = "",
SortOrder = 310,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(FeedsTab),
Type = typeof(PropertyPageReference))]
public virtual string FeedSource2 { get; set; }
[PageTypeProperty(EditCaption = "FeedSource3",
HelpText = "",
SortOrder = 320,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(FeedsTab),
Type = typeof(PropertyPageReference))]
public virtual string FeedSource3 { get; set; }
[PageTypeProperty(EditCaption = "Javascript in head",
HelpText = "Javascript in head",
SortOrder = 330,
UniqueValuePerLanguage = true,
Required = false,
Searchable = false,
Tab = typeof(JavaScriptTab),
Type = typeof(PropertyLongString))]
public virtual string JavaScriptInHead { get; set; }
[PageTypeProperty(EditCaption = "Target display",
HelpText = "Select the platform where this page is visible",
SortOrder = 350,
UniqueValuePerLanguage = true,
DefaultValue = PropertyTargetDisplay.Desktop,
DefaultValueType = DefaultValueType.Value,
Required = true,
Searchable = true,
Tab = typeof(InformationTab),
Type = typeof(PropertyTargetDisplay))]
public virtual string TargetDisplay { get; set; }
}
}
If you let the ASPX-template inherit TemplatePage instead of TemplatePage<T> and add a breakpoint somewhere in the page life cycle, what type is the object returned by CurrentPage?
Ok, finally then I did the changes I can open the site but my question now is if these changes could affect in the functionality of the site.
(TemplatePage instead of TemplatePage<T>)
I only meant that you should do them temporarily. You have a problem that the CurrentPage property returns an object that isn't of the expected type and to figure out the cause it would be good to know what type of object it does return. Typically this would only happen if the page type is mapped to a template file whose type parameter is a different type or if for some reason the id query string parameter is stripped causing the start page to be loaded instead of the expected page, as in the blog post.
Thanks Joel, I'm going to working to solve this issue based on your comments.
Hi all,
I'm working with EPIServer cms 6.0 and PageTypeBuilder 2.0 since a few day ago.
When I start my application an error is generated:
The current page is not of type DefaultPageType. This often occurs when no id query string parameter is specified.
Exception Details: PageTypeBuilder.PageTypeBuilderException: The current page is not of type DefaultPageType. This often occurs when no id query string parameter is specified
Stack Trace:
where I try to start the application with a aspx page that is called
Default.aspx
Can somebody help me?