login page does not show master page contents

Posted on 2008-11-12
Last Modified: 2013-11-26
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

Question by:manivineet
    1 Comment
    LVL 16

    Accepted Solution

    add this in your web config

          <location path="Path of your CSS and Image file">
                            <allow users="*" />

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    This video discusses moving either the default database or any database to a new volume.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now