|
-
Mar 19th, 2026, 10:12 PM
#7
Thread Starter
Member
Re: ASP Classic INCLUDE FILE Equivalent in ASP.NETs ASPX.vb or ASPX.cs
After over a year, I have found an answer to this lingering question of mine.
It is called Classes.
In ASP.NET, you create a Class and reference that Class within your other pages.
I am still learning and do not know enough to talk about it.
But I am using it right now in the new Upload script that I have had for years, with all 2,703 lines of code on one page.
I know that does not seem like much to most, but to me, I like being organized in my coding, and having many lines in one file is too much.
I have split it into many different Classes and referenced the classes.
Some I can do on my own, and others I have to get assistance from wherever I can find it.
For all those who are coming over from Classic ASP to ASP.NET
Whether you are a VB or C#, it is the same thing.
Instead of <!--include file="MyFile.asp"-->
You will create a Class.
VB
Code:
Public Class Customer
End Class
C#
Code:
public class Car
{
}
It is nice to finally know this, and I truly wish I had given it the time it deserved when I was first told about it about 8-10 years ago.
But I was stuck in my ways and did not want to learn anything new, and now today, I have no other choice.
Clean and fast code requires doing it right.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|