Solved

Run code on page load on a VB .aspx file

Posted on 2008-06-11
1
172 Views
Last Modified: 2013-11-05
Hi,

Sorry for the lame question, but I usually don't work in VB and I couldn't find anything satisfactory on Google.

How do I, in as VB .aspx file execute a piece of code on page load.
Something like in C#:

void Page_Load() {

 code here

}
 
I'm using Visual Studio 2008.

Any help would be appreciated.

Warm Regards,
Mário Gamito
0
Comment
Question by:angelsofgrace2006
1 Comment
 
LVL 48

Accepted Solution

by:
jpaulino earned 125 total points
ID: 21757827
You can use the page load event of the aspx page.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

   ' your code

End Sub

Open in new window

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now