具有母版页的Web窗体保持加载但不显示

时间:2018-04-22 03:54:42

标签: c# html asp.net

我正在构建一个C#asp.net应用程序,到目前为止,一切正常。我有2个母版页,除非我尝试从位于其中一个母版页中的名为' btnRegistrarse' 的按钮加载页面,否则它们的效果很好。无论我尝试加载的页面是否包含内容,都不会加载。

页面开始加载但没有显示,它在浏览器中继续这样做:

enter image description here

这是母版页的html:

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Login.master.cs" Inherits="ClinicaDental.Web.Login" %>

<!DOCTYPE HTML>
<html>
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Clínica Dental &mdash; Clínica Dental</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Free HTML5 Website Template by FreeHTML5.co" />
    <meta name="keywords" content="free website templates, free html5, free template, free bootstrap, free website template, html5, css3, mobile first, responsive" />
    <meta name="author" content="FreeHTML5.co" />

    <meta property="og:title" content=""/>
    <meta property="og:image" content=""/>
    <meta property="og:url" content=""/>
    <meta property="og:site_name" content=""/>
    <meta property="og:description" content=""/>
    <meta name="twitter:title" content="" />
    <meta name="twitter:image" content="" />
    <meta name="twitter:url" content="" />
    <meta name="twitter:card" content="" />

    <!-- <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"> -->

    <!-- Animate.css -->
    <link rel="stylesheet" href="css/animate.css">
    <!-- Icomoon Icon Fonts-->
    <link rel="stylesheet" href="css/icomoon.css">
    <!-- Bootstrap  -->
    <link rel="stylesheet" href="css/bootstrap.css">
    <!-- Theme style  -->
    <link rel="stylesheet" href="css/style.css">

    <!-- Modernizr JS -->
    <script src="js/modernizr-2.6.2.min.js"></script>
    <!-- FOR IE9 below -->
    <!--[if lt IE 9]>
    <script src="js/respond.min.js"></script>
    <![endif]-->

    </head>
    <body>

    <div class="fh5co-loader"></div>

    <div id="page">
    <nav class="fh5co-nav" role="navigation">
        <div class="container">
            <div class="fh5co-top-logo">
                <div id="fh5co-logo"><a href="#">Clínica Dental</a></div>
            </div>
            <form id="form1" runat="server">
            <div class="fh5co-top-menu menu-1 text-right">
                <ul>
                    <li><a>ID Usuario</a></li>
                    <li><a><asp:TextBox ID="txtCedula" runat="server" Width="116px"></asp:TextBox></a></li>
                    <li><a>Contraseña</a></li>
                    <li><a><asp:TextBox ID="txtContrasena" runat="server" TextMode="Password" Width="116px"></asp:TextBox></a></li>
                    <li><a><asp:Button ID="btnIngresar" runat="server" Text="Ingresar" OnClick="btnIngresar_Click" class="btn btn-primary" /></a></li>
                    <li><a><asp:Button ID="btnRegistrarse" runat="server" Text="Registrarse" OnClick="btnRegistrarse_Click" class="btn btn-primary" /></a></li>
                </ul>
            </div>

        </div>
    </nav>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

这是&#34; btnRegistrarse_Click&#34; 代码:

protected void btnRegistrarse_Click(object sender, EventArgs e)
    {
        Response.Redirect("Registro.aspx");
    }

修改

Registro.aspx:

  <%@ Page Title="" Language="C#" MasterPageFile="~/Login.Master" AutoEventWireup="true" CodeBehind="Registro.aspx.cs" Inherits="ClinicaDental.Web.Registro" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

</asp:Content>

有人可以帮帮我吗?提前谢谢。

1 个答案:

答案 0 :(得分:0)

最后,我不知道发生了什么。

我刚刚创建了一个新页面,并使用了作为模板的页面中的html代码,并将其作为我在新页面中所需的内容进行了调整,并且它有效。