Issue while trying to create a page from page type created using pagetype builder

153 Views Asked by At

I have created a pagetype using pagetype builder 1.3. In that pagetype builder i have defined a property.The code is like this

[PageType(Filename = "~/Templates/Public/Pages/Scheduling.aspx")]
public class Schedule : TypedPageData
{
    [PageTypeProperty(Type = typeof(PropertyLongString))]
    public virtual string RestURL { get; set; }

}

Then in my scheduling.aspx.cs file my code is like this

public partial class Templates_Public_Pages_Scheduling : TemplatePage<Schedule>
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

And in my schedule.aspx file I have tried to access them like this.

<div runat="server">
           <%= CurrentPage.RestURL %>
       </div>

But when trying to navigate the page I am getting the error

RightClickMenu requires a header control on the page. (e.g. ).

Why this error is coming

Thanks

Utpal

2

There are 2 best solutions below

0
On

The ContextMenu is the right click menu added by episerver to all pages. If your page is suppose to run with out it then youcan disable the context menu in pre init:

protected override void OnPreInit(EventArgs e) 
{ 
   ContextMenu.IsMenuEnabled = false; base.OnPreInit(e); 
}

If you wish to have the right click menu then you need to have a header control so that epi is able to add it.

0
On

You are probably missing <head runat="server"> in your template.