Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 21st, 2003, 07:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
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
************************************
  #2 (permalink)  
Old August 21st, 2003, 08:48 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.

  #3 (permalink)  
Old August 21st, 2003, 01:18 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
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?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:42 PM.


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