November Happy Hour will be moved to Thursday December 5th.

Context error

Vote:
 

Hi, im relatively new to EPiServer and are just now playing around with it and trying to learn the basics.

I am trying to make my own Page, and has created a new 'Web Content Form'  under 'Pages' in Visual Studio.

The page, FrontPage.aspx, is edited and i try to include : 

<asp:Content ID="Content4" ContentPlaceHolderID="MainBodyRegion" runat="server">
<%= (CurrentPage["PageType"]).ToString() %>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MainBodyRegion" runat="server">

<%= (CurrentPage["PageType"]).ToString() %>

</asp:Content>

 

And this is where my troubles start, now i get an error stating : The name 'CurrentPage' does not exist in the current context

 

I have added the following in the FronPage.aspx.cs file:

 

public partial class FrontPage : TemplatePage

 

Anyone know what the error is ?

#42434
Aug 24, 2010 9:49
Vote:
 

Have you rebuilt the project after changing which class the page inherits from? Do the Inherits and Codebehind properties of the page directive in the aspx match the namespace and name of the codebehind file (aspx.cs)?

#42435
Edited, Aug 24, 2010 10:01
Vote:
 

Thanks alot, a simple rebuild fixed it all! Im not that familiar with VS as i thought ;)

#42436
Aug 24, 2010 10:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.