This is weird. I added a brand new Web Application project to my solution in Visual Studio 2008.
Created a master page. Made zero modifications. Created a new we
In my case runat="server"
was missing in the asp:content tag. I know it's stupid, but someone might have removed from the code in the build I got.
It worked for me. Someone may face the same thing. Hence shared.
Better late than never i suppose... you get the option to set the MASTERPAGE only of you are developing a WEB SITE (FILE>NEW>WEBSITE)... but not when you create an ASP.NET project (FILE>NEW>PROJECT) - there you have to set the Masterpage using the properties of the newly created webform and it's up to you to modify the ASPX source to make it master page compliant (ie, removing the stock HTML, etc...)
protected void Page_PreInit(object sender, EventArgs e)
{
if (Membership.GetUser() == null) //check the user weather user is logged in or not
this.Page.MasterPageFile = "~/General.master";
else
this.Page.MasterPageFile = "~/myMaster.master";
}
When you created the WebForm, did you select the Master page it is attached to in the "Add New Item" dialog itself ? Or did you attach it manually using the MasterPageFile
attribute of the @Page
directive ? If it was the latter, it might explain the error message you receive.
VS automatically inserts certain markup in each kind of page. If you select the MasterPage at the time of page creation itself, it does not generate any markup except the @Page
declaration and the top level Content control.
For some reason, there is no option in the create page dialogue to select a master page. I have tried both programatically declaring the MP and by updating the property in the Properties pane. – NoCarrier 13 mins ago
I believe its because i'm using a "web application" vs a "web site" – NoCarrier 9 mins ago
Chances are it is in the <@PAGE> tag where your problem is. That said, it doesnt make a difference if you are using a Web Application or not. To create a Child Page, right click on your master page in the Solution Explorer and choose Add Content Page.
Just got this problem. It was because we had a tag ending with double slashes:
<//asp:HyperLink>