login page does not show master page contents

I have a Login.aspx page that I created based upon a "MasterPage.master" page.  It looks fine in the designer but when I go to run it the login control shows up but there is no formatting almost as if the MasterPage.master or CSS are disconnected.  I then login and everything is fine.

The startup page is "Default.aspx" but the user is taken to the "Login.aspx" page because these "web.config" settings:

        <deny users="?" />
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx" path="/" />
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Untitled Page" %>
<script language="C#" runat="server">
    void Login_Click(Object sender, EventArgs E) {
        if (((UserEmail.Value == "test") && (UserPass.Value == "password")) || ((UserEmail.Value == "test") && (UserPass.Value == "password")))
        FormsAuthentication.RedirectFromLoginPage(UserEmail.Value, PersistCookie.Checked);
      else {
        Msg.Text = "Invalid Credentials: Please try again";
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="cphMainContent" Runat="Server">
    <form runat="server">
    <h3><font face="Verdana">Login Page</font></h3>
          <td><input id="UserEmail" type="text" runat="server"/></td>
          <td><ASP:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="UserEmail" Display="Static" ErrorMessage="*" runat="server"/></td>
          <td><input id="UserPass" type="password" runat="server"/></td>
          <td><ASP:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="UserPass" Display="Static" ErrorMessage="*" runat="server"/></td>
          <td>Persistent Cookie:</td>
          <td><ASP:CheckBox id="PersistCookie" runat="server" /> </td>
      <asp:button ID="Button1" text="Login" OnClick="Login_Click" runat="server"/>
      <asp:Label id="Msg" ForeColor="red" Font-Names="Verdana" Font-Size="10" runat="server" />
<asp:Content ID="Content3" ContentPlaceHolderID="cphLeftNavigation" Runat="Server">

Open in new window

Who is Participating?
Gyanendra SinghArchitectCommented:
add this in your web config

      <location path="Path of your CSS and Image file">
                        <allow users="*" />
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.