homepage Welcome to WebmasterWorld Guest from 54.166.255.168
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Help With Using Visual Web Developer and Asp.net
BlackRaven

10+ Year Member



 
Msg#: 3596993 posted 1:18 am on Mar 11, 2008 (gmt 0)

I am in the process of learning asp.net on the MS VWD2008. However my first basic code doesn't seem to run properly, i mean i get no errors however the timelabel does not change either, see output code.

========================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<script runat="server" language="vbscript">
Sub Page_load(sender As Object, e As EventArgs)
timelabel.Text = DateTime.Now.ToString()
End Sub
</script>
<!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>
</head>
<body>
Hello There !<br />
The Time now is <asp:Label runat="server" id="timelabel" />

</form>
</body>
</html>

=======================
The Output
=======================

<!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><title>
Untitled Page
</title></head>
<body>
Hello There !<br />
The Time now is <span id="timelabel"></span>

</form>
</body>
</html>

 

Response

5+ Year Member



 
Msg#: 3596993 posted 1:55 pm on Mar 11, 2008 (gmt 0)

Hello BlackRaven,

Your missing part of the event handler

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Visual Studio's ability to auto generate your page events is a nice feature of the IDE. Selecting (Page Events) and an event in the code behind page, will generate the handler for you.

[edited by: Response at 1:57 pm (utc) on Mar. 11, 2008]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved