Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple ASP.Net Problem

Status
Not open for further replies.

djpic

IS-IT--Management
Feb 27, 2006
69
US
I am having a problem just posting a simple message on an ASP.Net site. The following is the dbtest.aspx page code:

==========================================================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="dbtest.aspx.vb" Inherits="dbtest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns=" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblTableOutput" runat="server"></asp:Label></div>
</form>
</body>
</html>
==========================================================

Here is the dbtest.aspx.vb file:

==========================================================
Partial Class dbtest
Inherits System.Web.UI.Page
Sub Page_Load(ByVal Sender As Object, ByVal e As EventArgs)
lblTableOutput.Text = "Test"
End Sub
End Class
==========================================================

Why is this not working? I am not even getting an error?
 
You need to have a "Handles" event for the Page Load sub


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
It has been like 1 and half years since working with asp.net, what is that exactly and where does need to go? I do remember having to do something with that. I am used to using visual studio 2003 to develope the pages but becuase of some problems with the server, I was forced to use Visual Web Developer 2005 Express (free software from microsoft).
 
You'll need one of the two example from below depending on which version of the framework you are using:
Code:
Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) [b]Handles Me.Load[/b]
Code:
Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) [b]Handles MyBase.Load[/b]


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
On the page go to Design view and double click in an empty space, it should create the pageload event for you.

Another way is to just go to Page Events in the drop down at the top of the code behind page then in the second drop down select Load, and that should create the event for you as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top