473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

codebehind and page_load event

hello and thanks

I am as green as mold when it comes to asp.net, so please bear with
me.

I am trying to get an asp.net page with a webform to work using
codebehind. My class/routines work fine, just doing simple stuff like
changing the text of lables.

I cant seem to get this to work though;

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Label8.Text = "pre ELSEIF"
If IsPostBack Then
Label8.Text = "is postback"
Else
Label8.Text = "is NOT postback"
End If
Label8.Text = "post ELSEIF"
End Sub

any ideas why the page_load event doesnt fire, or if it does, why
label8 doesnt change?

thanks

maurice
Nov 17 '05 #1
1 1505
Unless you're using auto-event wireup, add a "Handles MyBase.Load" at the
end of the the Page_Load line:

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

Eric
"Maurice Walmsley" <mb********@hotmail.com> wrote in message
news:92**************************@posting.google.c om...
hello and thanks

I am as green as mold when it comes to asp.net, so please bear with
me.

I am trying to get an asp.net page with a webform to work using
codebehind. My class/routines work fine, just doing simple stuff like
changing the text of lables.

I cant seem to get this to work though;

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Label8.Text = "pre ELSEIF"
If IsPostBack Then
Label8.Text = "is postback"
Else
Label8.Text = "is NOT postback"
End If
Label8.Text = "post ELSEIF"
End Sub

any ideas why the page_load event doesnt fire, or if it does, why
label8 doesnt change?

thanks

maurice

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Colin | last post by:
Hi there, I really need your help on this. I'm trying to learn to using the VS.2003 to create a User Control. In my aspx code has no problem to use the property "grossWaye" that has "register" in...
0
by: Maurice Walmsley | last post by:
hello and thanks I am as green as mold when it comes to asp.net, so please bear with me. I am trying to get an asp.net page with a webform to work using codebehind. My class/routines work...
3
by: nevets2001uk | last post by:
Hi. I've just started my second ASP.NET (VB) app and I'm using codebehind this time. I'm not using visual studio but am instead coding it all in notepad (HTML, ASP.NET and CSS) I'm trying to...
12
by: Karl Hungus | last post by:
If I use a code behind class for an aspx page, what is the best way to get data from the codebehind class into my aspx page? I know about databinding, but is there a more basic way of just...
5
by: Gary Vidal | last post by:
I have a client side Javascript which checks an OrderQuantityField against a hidden Textbox of the Minimum Order Quantity. I dont want to do validation on a postback. I would like to be able to...
0
by: rahulkate | last post by:
Hello Everybod I have a problem hope you can help me out I have a treeview and on the selectedindexchange event of the treeview I want to execute some code from the vb codebehind file and a...
6
by: Thomas Andersson | last post by:
Hi all, I've been thinking of about adding new languages to our website and is currently investigating how this could be done. And I know that one way to go would be to create new aspx-pages...
2
by: landers | last post by:
Hi All, I have created a vb file that inherits a System.Web.UI.Page. As I am against duplicating source code, I have set the Codebehind attribute on all my aspx pages in the same directory. ...
1
by: Randall Parker | last post by:
Using VS 2003 and Cassini web server. I'm new to ASP.Net and so this may be a dumb question. I'm getting an error where the type 'FarmLand.WebForm1' is not found. The Codebehind C# source file...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.