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

Reusable functions

In classic ASP, if I have a function that will be used many times, I just
put it in include file, and add, for example <!-- #include
file='myfunction.inc' --> in the file where I want to use that function.

How do I do this in ASP.Net? Got bit confused, especially because HTML and
the VB.Net code is located in separate files.

Thanks in advance,

- Danny
Nov 18 '05 #1
3 1596
Danny wrote:
In classic ASP, if I have a function that will be used many times, I
just put it in include file, and add, for example <!-- #include
file='myfunction.inc' --> in the file where I want to use that
function.


You gotta change your mindset. Look into "class libraries." They work
different, but are infinitely better than #included files.

--
gabriel
Nov 18 '05 #2
ASP is procedural, whereas ASP.Net is object-oriented. In ASP, you could
create re-usable functions. In ASP.Net, you create re-usable classes, which
are much better, because they can contain functions (Methods) as well as
data (Properties and Fields). Instead of including them with server-side
includes, you reference them (the assemblies/DLLs containing them) from your
other classes.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Danny" <da******@NoSPAMmyrealbox.com> wrote in message
news:eb**************@TK2MSFTNGP10.phx.gbl...
In classic ASP, if I have a function that will be used many times, I just
put it in include file, and add, for example <!-- #include
file='myfunction.inc' --> in the file where I want to use that function.

How do I do this in ASP.Net? Got bit confused, especially because HTML and
the VB.Net code is located in separate files.

Thanks in advance,

- Danny

Nov 18 '05 #3
Thanks Kevin & Gabriel for guiding me to the right path.

- Danny

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
ASP is procedural, whereas ASP.Net is object-oriented. In ASP, you could
create re-usable functions. In ASP.Net, you create re-usable classes, which are much better, because they can contain functions (Methods) as well as
data (Properties and Fields). Instead of including them with server-side
includes, you reference them (the assemblies/DLLs containing them) from your other classes.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Danny" <da******@NoSPAMmyrealbox.com> wrote in message
news:eb**************@TK2MSFTNGP10.phx.gbl...
In classic ASP, if I have a function that will be used many times, I just put it in include file, and add, for example <!-- #include
file='myfunction.inc' --> in the file where I want to use that function.

How do I do this in ASP.Net? Got bit confused, especially because HTML and the VB.Net code is located in separate files.

Thanks in advance,

- Danny

Nov 18 '05 #4

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

Similar topics

0
by: Tony Marston | last post by:
For those of you who think that using XSL/XML to create your HTML output from a PHP application is not a viable proposition as XSL is a clunky language, it is too verbose and it cannot get the job...
2
by: John | last post by:
Hi, I have a data driven application which has some generalized components. So, for reuse, I am building the components so they can be reused in other projects ... it takes almost no extra...
3
by: Axter | last post by:
I'm wondering about the practical use of dynamic_cast in reusable or generic code. I'm currently working on a smart pointer that can be used on vector and other STL containers. See following...
27
by: Matt Kruse | last post by:
Since this topic has come up several times in other threads, I thought I'd make a separate thread and gather opinions from (hopefully) a more varied range of newsgroup participants. What are...
2
by: DaleMan | last post by:
Where can I learn more about reusable businesss objects and their uses? I've been reading that one of .Net's advantages is that a developer can write reusable business objects. I would like to...
3
by: Nikki | last post by:
Hi, I would like to create a central storage place for javascript functions that I can then access from any of my asp.net projects. An example of what I need it for is as follows: I have a...
0
by: Toby Inkster | last post by:
Like me, you are probably confronted with many requests for surveys, questionnaires, feedback forms, registration forms and so forth: forms where the processing requirements are very simple (store...
3
by: jduhler | last post by:
Is there a way in SQL Server T-SQL to store commonly used SQL statements in a function, stored proc, or system variable? That way if that code ever changes I can change it in one place. If I...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.