unexpected authectication behavior in ASP.NET example app. Apress

G

Guest

Hi,
I am following along an example from the book <b>Beginning Visual Web
Programming in C#</b>

My environment is this:
IIS 5.1 on XP Pro, I have the checkbox 'use windows integrated
authentication' unchecked, and I am allowing anonymous access.

Prior to building the example that is giving the error, the app would ask
you to login if you weren't already logged in by redirecting you to the login
page.

In the case of the example, for testing purposes you are instructed to enter
a url with a parameter appened to the URL. What is supposed to happen is
you will be redirected to the login page, then once you login you should be
redirected back to the original page that was in the url with the appended
parameter, that parameter being used to pull some data from the db and
display on this page.

I have carefully checked my code, and even used the authors code downloaded
from apress with the same error. I will post the code, but what I am really
looking for is a general guideline how to debug this issue. I am wondering if
this is a bug, or error in their program.

I am new to C# and asp.net, looking at this as a learning opportunity, but
also feeling frustrated.

viewuser.aspx
<code>
<%@ Page language="c#" Codebehind="viewuser.aspx.cs" AutoEventWireup="false"
Inherits="FriendsReunion.viewuser" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>viewuser</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<LINK href="styles/iestyle.css" type="text/css" rel="stylesheet">
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<TABLE class="TableLines" id="tbLogin" cellSpacing="2" cols="2"
cellPadding="2" border="0">
<TR>
<TD align="right" colSpan="1" rowSpan="1">
<P align="right">name:</P>
</TD>
<TD>
<asp:Label id="lblName" runat="server"
Text='<%# dsUser.Tables[0].Rows[0]["FirstName"] + " " +
dsUser.Tables[0].Rows[0]["LastName"] %>'>
</asp:Label>
</TD>
</TR>
<TR>
<TD>birth date:</TD>
<TD>
<asp:Label id="lblBirth" runat="server"
Text='<%#
DataBinder.Eval(dsUser.Tables[0].Rows[0],"[DateOfBirth]","{0:MMMM dd,
yyyy}")%>'>
</asp:Label>
</TD>
</TR>
<TR>
<TD>
<P align="right">phone number:</P>
</TD>
<TD>
<asp:Label id="lblPhone" runat="server"
Text='<%#
DataBinder.Eval(dsUser.Tables["User"].Rows[0],"[PhoneNumber]") %>' >
</asp:Label>
</TD>
</TR>
<TR>
<TD>
<P align="right">mobile number:</P>
</TD>
<TD>
<asp:Label id="lblMobile" runat="server"
Text='<%# dsUser.Tables["User"].Rows[0]["CellNumber"] %> '>
</asp:Label>
</TD>
</TR>
<TR>
<TD>
<P align="right">address:</P>
</TD>
<TD>
<asp:Label id="lblAddress" runat="server"
Text='<%#
DataBinder.Eval(dsUser.Tables["User"].Rows[0],"[Address]") %> '>
</asp:Label>
</TD>
</TR>
<TR>
<TD>
<P align="right">email:</P>
</TD>
<TD>
<asp:HyperLink id="lnkEmail" runat="server"
NavigateUrl='<%#
DataBinder.Eval(dsUser.Tables["User"].Rows[0],"(e-mail address removed)
 
G

Guest

The actual error that I am getting is
Login Failed for user '[my computer name\ASPNET'

This happens when the page is redirected to the login page, and I login
with a user that exists in the database. If I go back to the page, using
the back button I can see that I am in fact logged in as that user, but I
can't access that page
(viewuser.aspx)

Thanks in Advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top