Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2003, 07:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default Pages not viewing properly

I'm now using VS.NET 2002.

The problem is when I view the page I don't see anything. Just a blank page. However, when I click view source i see my HTML code.


Here is my HTML:
---------------------------------------------
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="Web1.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.0">
        <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
        <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">
            <span id="spnAuthenticated" runat="server"></span>
            <span id="spnUserName" runat="server"></span>
            <span id="spnAuthenticationType" runat="server"></span>
        </form>
    </body>
</HTML>
----------------------------------------------

Here is my code behind:
********************************************8
Imports System.Web.Security
Public Class WebForm1
    Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        spnAuthenticated.InnerText = User.Identity.IsAuthenticated
        spnUserName.InnerText = User.Identity.Name
        spnAuthenticationType.InnerText = User.Identity.AuthenticationType
    End Sub
End Class
************************************
 
Old August 21st, 2003, 08:48 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Firstly, I'm surprise you didn't get a build/run error.

You need to have your spans defined as class fields in the code behind otherwise there's no tie between the ones on the page and the references to them in the codebehind.

Protected WithEvents spnAuthenticated As HtmlGenericControl
Protected WithEvents spnUserName As HtmlGenericControl
Protected WithEvents spnAuthenticationType As HtmlGenericControl

That's my guess.

 
Old August 21st, 2003, 01:18 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Thanks, that worked but it didn't do what I wanted it to do. I was hoping that this code:

--------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        spnAuthenticated.InnerText = User.Identity.IsAuthenticated
        spnUserName.InnerText = User.Identity.Name
        spnAuthenticationType.InnerText = User.Identity.AuthenticationType
    End Sub
--------------------------

would authenticate a user onto the server without having the login box popup.

Is there anything I need to do on the servers to get it to work?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Pages, Content Pages and CSS carliviris Visual Studio 2005 0 January 8th, 2008 05:56 PM
Viewing created ASP pages on network computer bomanda ASP.NET 1.0 and 1.1 Basics 13 February 16th, 2007 07:51 AM
Viewing Data Access Pages thru internet pans HTML Code Clinic 1 February 2nd, 2005 09:57 PM
Web pages constructing: I-mode(mobile) pages karib Dreamweaver (all versions) 3 June 6th, 2004 09:48 AM
Viewing ASP pages bnorg ASP.NET 1.0 and 1.1 Basics 10 September 14th, 2003 12:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.