Solved

Run code on page load on a VB .aspx file

Posted on 2008-06-11
1
198 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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Creating a route in asp.net webforms 2 32
Complex SQL statement in VB.NET 7 31
Error message when using PrintSocket.Send 7 18
Very Large data in MYSQL 7 73
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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