c# - ASP.NET 起始页始终加载母版页

标签 c# asp.net visual-studio master-pages

无论我做什么,我的 Web 应用程序起始页始终是 MasterPage。我有一个大多数页面继承的母版页,但我也有一个“Entrada.aspx”作为登陆页面,它不继承母版页。我希望“Entrada.aspx”是默认页面,但我不能以任何方式设置它。

这是标题:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Entrada.aspx.cs" Inherits="webapp.Entrada" %>

我已将 Entrada.aspx 设置为 webapp Visual Web Properties -> Start Action 中的起始页

Specific Page: Entrada.aspx

我也在 web.config 中设置了它:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<defaultDocument enabled="true">
  <files>
    <clear/>
    <add value="Entrada.aspx"/>
  </files>
</defaultDocument>

而且也不起作用。

我已经在 Visual Web 上下文菜单“设置为起始页”中设置了它,但它也不起作用。

最佳答案

您使用的是 Visual Studio Development Server,无需转到 localhost:59852 进行调试。只需让地址为 localhost:59852/Entrada.aspx。
但是在您使用 IIS 的生产服务器中,它可以工作。

关于c# - ASP.NET 起始页始终加载母版页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21684807/

相关文章:

c# - 文本框可见属性

C#:如何从派生类的静态方法调用基类的静态方法?

asp.net - 当页面显示在 jQuery 对话框和 iFrame 中时调整图像大小

c++ - 是否可以从 .sln 文件读取/检索 C++ 源代码?

c# - TypeLoadException - 如何继续

c# - 在整个 C# 解决方案中应用 Visual Studio 快速操作和重构

.net - ASP.NET 的自定义文件扩展名 - 需要帮助!

c# - 字符串或二进制数据将被截断。该语句已终止。上传个人资料时

visual-studio - react-native run-windows 给出错误 : Certificate could not be opened: TemporaryKey. pfx 错误

c# - 在 mstest 期间创建文件 - System.UnauthorizedAccessException