469,612 Members | 1,639 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Login form displays correct URL in addres bar but only displays itself

The following code (web.config in Visual Studio 2005) is supposed to redirect a user to the appropriate Form depending on their role.

However, regardless of the user's role, the only page displayed is the login page with the URL of the page the user was supposed to go to being displayed in the address bar.

A valid user is:
name "sandy"
password = san_mcd
role = Administrator

This user should be redirected to frm_Management

************************************************** ***

<?xml version="1.0"?>
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
<allow roles="Administration" />
<allow roles="Management" />
<allow roles="Sales" />
<allow roles="Technician" />
<allow roles="Workshop" />
<deny users="*" />
<deny users="?" />
<roleManager enabled="true" />
<compilation debug="true" strict="false" explicit="true"/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
<authentication mode="Forms" >
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />

<forms name="SandariCookie"
timeout="40" path="/" />


<location path="frm_Administration.aspx">
<deny users="?" />
<deny users="*" />
<allow roles="Administration, Management, Workshop" />

<location path="frm_Management.aspx">
<deny users="?" />
<deny users="*" />
<allow roles="Management" />

<location path="frm_Sales.aspx">
<deny users="?" />
<deny users="*" />
<allow roles="Sales, Management" />

<location path="frm_Technician.aspx">
<deny users="?" />
<deny users="*" />
<allow roles="Technician, Management" />


This is the code behind the login form:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Default4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<form id="form1" runat="server">
<div id="log_Login" title="Login">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Italic="True" Font-Size="X-Large"
Style="z-index: 100; left: 280px; position: absolute; top: 13px" Text="Home Visits for Sick Computers"
<br />
<asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="XX-Large" Style="z-index: 101;
left: 288px; position: absolute; top: 53px" Text="Stock and Job Manager" Width="400px"></asp:Label>
<br />
<br />
<br />
&nbsp; &nbsp;&nbsp;&nbsp;<br />
<br />
&nbsp;<br />
<br />
<asp:LoginView ID="LoginView1" runat="server">
&nbsp; &nbsp;<br />
<br />
<br />
<asp:Login ID="cmdLogin" runat="server" BackColor="#F7F7DE" BorderColor="#CCCC99" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt" Style="z-index: 104;
left: 360px; position: absolute; top: 312px"
CreateUserText="Register for the first time."
PasswordRecoveryText="Forgot your password?"
<TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
&nbsp; &nbsp;


Can anyone help, please?
Nov 5 '07 #1
0 1296

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Tony W | last post: by
2 posts views Thread by James X. Li | last post: by
1 post views Thread by EricRybarczyk | last post: by
7 posts views Thread by Chuck Anderson | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.