954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Error with Master Page

i created an introduce (start) page .. and through that page i have to move to a master page.
but this error appear

This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.master' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

Requested URL: /WebSite2/MasterPage.master

help me :$

DATABASE
Light Poster
32 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

You don't actually serve (e.g. link to) the masterpage. The .aspx file refers to the masterpage, so the server knows to put everything together correctly. This allows you to use the same masterpage on your entire site (e.g. to preserve a constant layout easily) but still link to each page. So, you'll need a content page for your masterpage and then you just link to that :)

Infarction
Posting Virtuoso
1,580 posts since May 2006
Reputation Points: 683
Solved Threads: 53
 

I am using VS 2008, IIS 5.1, IE 7 on XP SP2.

I have a master page and two content pages. When I debug the code, it displays the first content page. In the first page I have a button that redirects to the second content page.

When I click the button, the address bar in IE7 displays the URL for the master page and says the page is not served, forbidden etc.

Please let me know how to fix this.

Jumbo12
Newbie Poster
2 posts since Mar 2009
Reputation Points: 10
Solved Threads: 0
 

Hi Jumbo,
A infarction said, you don't ever link to the Master Page url so probably in your code you have something like:
protected void btnTest_Click(object sender, EventArgs e)
{
Response.Redirect("YourMasterPage.master");
}

But it should read: protected void btnTest_Click(object sender, EventArgs e)
{
Response.Redirect("YourContentPage.aspx");
}

sedgey
Junior Poster
131 posts since Jan 2007
Reputation Points: 68
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You