Previous
Left Arrow
ASP.NET - How to create a Reusable Replace Function in VB.NET
Current Code Entry
Go Back To Code List
[VB.NET]
  • Creating and Using Global Variables on both your Frontend and Backend ASP.NET VB Pages.

    Article Entry Date: March 11,2026 @ 04:34:30 / Last Updated On: March 11,2026 @ 04:39:13
Creating Global Variables is something we have to do in ASP.NET. In Classic ASP, it just worked, but not in ASP.NET.
In this article, we will look at both of these Variables that can be used throughout our page.

▼ Frontend ▼

Place this at the top of your page.

Now, on our page, we can use either of these variables.
Create your Select Statement. Then add in your Global variable like this.

Now, anywhere on our page, we can use this.
<%=GlobalVariables.getfile%> Will get the value assigned to this Variable.
▼ Backend ▼

The same concept will work in the Codebehind as well.
Except without the Code Brackets.

GlobalVariables.getfile