473,406 Members | 2,217 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,406 software developers and data experts.

Page_Load subroutine

Hi all.

Just one question about Page_Load subroutine

I have the following code

<script runat="server">
Sub Page_Load
if Not Page.IsPostBack then
dim mycountries=New ArrayList
mycountries.Add("Norway")
mycountries.Add("Sweden")
mycountries.Add("France")
mycountries.Add("Italy")
end if
end sub
</script>

and after all, i have this <asp:blahblah- /> line to
display the elements in the array.

but everytime when i looked at this page, i don't see any
of the displays..

i also tried

sub Page_load
msg1.text = "welcome"
end sub

and..<asp:label id = "msg1" runat ="server">

but the text "welcome" does not show up.

What's wrong with this?

I need this really badly right now
Thank you all

Nov 18 '05 #1
1 1091
Hi,

1) your function is missing eventhandler delegator parameters.
2) you need to declare which event this function is handle.

<script runat="server">
Sub Page_Load(ByVal sender as System.Object, ByVal e as
System.EventArgs) Handels MyBase.Load

end sub
....
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

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

Similar topics

16
by: thejackofall | last post by:
Hi. I have a button called btnSelect on a web form. There is a handler for it. However, the Page_Load() gets called before the handler gets called. I want to do the following. In the...
1
by: darrel | last post by:
I'm trying to create a usercontrol that links to the same page as it is on along with a new query string in hopes that I can trigger the 'Sub Page_Load' to grab the querystring and reformat the...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
2
by: Sparky Arbuckle | last post by:
First and foremost, is it possible to execute two SQL statements that grab different data out of the same database in the same Page_Load subroutine? I am building a music store and want to do a...
1
by: Paul | last post by:
Would you expect there to be a problem if I used a Page_Load routine in both the header UserControl .ascx file, as well as the base .aspx file? For example, I want to use a ADO statement with a...
2
by: Redeem | last post by:
is Page_Load Subroutine a system defined soubroutine meaning it isn't user defined? I assume any code I place under that routine name will automatically load when web page is run is it ? ...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
0
by: KY Lui | last post by:
I am developing a simple message sending application. A page (message.aspx) is used for message writing and message status confirmation. eg. A user access message.aspx to write a message, a send...
8
by: John Austin | last post by:
I need to understand why if I add a control and use AddHandler to connect its click event, it will work in Page_Load, but not in a Button_Click. The idea is that the user types some data, presses...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.