简体   繁体   English

ASP.NET - 我不想为页面使用母版页

[英]ASP.NET - I do not want use master page for a page

My problem is that I cannot release my page without master page.我的问题是没有母版页我无法发布我的页面。 I have a master page but I want to redesign my sign-up page, so I do not want to use the master page for the sign-up page.我有一个母版页,但我想重新设计我的注册页面,所以我不想将母版页用于注册页面。

If I delete master page string from register.aspx page get an error.如果我从 register.aspx 页面中删除母版页字符串,则会出现错误。

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Hackerdot.Register" %>

I tried deleting MasterPageFile="~/Main.Master" but then the page did not compile.我尝试删除MasterPageFile="~/Main.Master"但随后页面没有编译。

PS: I don't have the source code, I am just doing a redesign of this website. PS:我没有源代码,我只是在重新设计这个网站。

在此处输入图片说明

In order to remove a Master Page from one of your pages, you must do the following (if they apply):为了从您的一个页面中删除母版页,您必须执行以下操作(如果它们适用):

  • Remove the MasterPageFile attribute form your Page directive.从您的Page指令中删除MasterPageFile属性。
  • Remove the MasterType directive.删除MasterType指令。
  • Remove any <asp:Content> tags you have on the page.删除页面上的所有<asp:Content>标记。
  • Remove any references to the Master property in your code behind (and rebuild!)删除后面代码中对Master属性的任何引用(并重建!)

Also, any dependencies that exist in your Master Page will need to be moved down to your Page, such as a <asp:ScriptManager> .此外,您的母版页中存在的任何依赖项都需要下移到您的页面,例如<asp:ScriptManager>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM