Solved

ASP.NET 2.0 - Login.aspx loses Master Page settings during runtime

Posted on 2006-11-07
6
1,315 Views
Last Modified: 2011-01-22
I have a Login.aspx page that I created based upon a "Template.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 Template.master or CSS are disconnected.  I then login and everything is fine.  Weird.

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

    <authorization>
        <deny users="?" />
    </authorization>
   
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx" path="/" />
    </authentication>

Any ideas or thoughts are GREATLY appreciated,

Hammer
0
Comment
Question by:HAMMER33333
  • 3
  • 2
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17897548
Where is the CSS coming from--the template folder?

Bob
0
 

Author Comment

by:HAMMER33333
ID: 17898597
The Template.master is in the root directory and so is the CSS ("layout.css").  The CSS is linked like this:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="layout.css" />
<title>Testing</title>
<script type="text/javascript" >
    function PopTheWindow(pageName, pageFeatures)
    {
        window.open(pageName, null, pageFeatures);
    }
</script>
</head>
<body>
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17898696
Where is the login control in relation to Template.master?

Bob
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:HAMMER33333
ID: 17900946
The Login is an Aspx page (Login.aspx) based upon Template.master.  It is in the same directory as Template.master, the root directory.

It's HTML is:

<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Login" %>

<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server" Visible="true">
    <asp:Login ID="Login1" runat="server">
    </asp:Login>
</asp:Content>

Weird stuff because it looks fine in the designer.

Hammer
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17905454
That is too strange :(

Bob
0
 

Expert Comment

by:jmyonan
ID: 34675196
No one gave a solution to this problem...so here is the solution...

You need to set the authentication on the images/css folder to allow everyone.  It would look something like this in the web.config:

<location path="Images">    
    <system.web>        
        <authorization>            
             <allow users="*"/>        
        </authorization>    
    </system.web>
</location>
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

18 Experts available now in Live!

Get 1:1 Help Now