page 372 dev web applications book

G

Guest

Hi I am trying to run a simple windows authentication example in the Microsoft web apps book page 372 and
in the page load sub I am getting the errors, name spnAuthenticated not declared, spnUserName not declared, spnAuthenticationType not declared

In startup pageload subroutine, I hav
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
'Put user code to initialize the page her
spnAuthenticated.InnerText = User.Identity.Nam
spnUserName.InnerText = User.Identity.Nam
spnAuthenticationType.InnerText = User.Identity.AuthenticationTyp
End Su
In my web.config file I hav
<authorization><deny users="?" /><!-- Allow all users --><!-- <allow users="[comma separated list of users]
roles="[comma separated list of roles]"/><deny users="[comma separated list of users]
roles="[comma separated list of roles]"/
--></authorization

In the HTML of startup page I added the table definition and hav

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="authentication_test.WebForm1"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><title>WebForm1</title><meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body MS_POSITIONING="GridLayout"><form id="Form1" method="post" runat="server">&nbsp
<TABLE id="tbUser"><TR><TD>Authenticated</TD><TD><span runat="server" id="spnAuthenticated"></span></TD><TD>User Name</TD><TD><span runat ="server" id="spnUserName"></span></TD><TD>Authentication type </TD><TD><span runat="server" id ="spnAuthenticationType"></span></TD></TR></TABLE></form></body></HTML
I had to put the <tr></tr>tags above and below the <TD> tags as I got an error <TD> not allowed within table
In the book on page 372 it does not have the <TR> ta
Also just wondering why spnAuthenticated, ect is not declared. Thanks Paul.
 
G

Guest

The spnAuthenticated may be hidden from you. Expand the portion of the code behind file in the " Web Form Designer Generated Code " region ... it is most likely defined in there since you are working in VB.NET
 
G

Guest

ok thanks for the information. I just re-opened the project and expanded that section of code and it built ok.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top