Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is VB6 and
ASP3. Right now, I'm evaluating strategies on creating reusable and common
functions and methods for ASP.NET. In ASP 3, it was nothing more than
functions and methods coded in #Include Files. Now ASP.NET offers features
such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that can be
reused (i.e called it) in 10 different ASPX pages, what do I do? Do I create
a model page which contains the classes and inherit them? Or do I just
create a VB file containing all the functions and I can call the functions
from other ASPX pages once I compile them? Or do I create ASCX web controls?
But right now, basically all I need to do is the code only reusable
component and no UI.
Please advice on the best method to create reusable functions and methods
segments for ASP.NET. Also URL pointers on explaining step-by-step
procedures on recommended method(s) will be greatly appreciated!!!
Thanks you all in advance!
Don 6 1534
Both methods will work for you. Inheritance may be the easiest to use and
the simplist but it will depend a bit on what you are doing. If these are
simple functions then the page is great. If they are larger it might be
easier to place them into a class and call it when needed. I tend to use a
combination. I have inherited pages, inherited classes and seperate files
sometimes all within the same app. I know that's not quite what you wanted
to hear but without specifically seeing your usage it's the best I can say.
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Don Wash" <do*@wash.com > wrote in message
news:uP******** *****@TK2MSFTNG P12.phx.gbl... Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is VB6
and ASP3. Right now, I'm evaluating strategies on creating reusable and common functions and methods for ASP.NET. In ASP 3, it was nothing more than functions and methods coded in #Include Files. Now ASP.NET offers features such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that can be reused (i.e called it) in 10 different ASPX pages, what do I do? Do I
create a model page which contains the classes and inherit them? Or do I just create a VB file containing all the functions and I can call the functions from other ASPX pages once I compile them? Or do I create ASCX web
controls? But right now, basically all I need to do is the code only reusable component and no UI.
Please advice on the best method to create reusable functions and methods segments for ASP.NET. Also URL pointers on explaining step-by-step procedures on recommended method(s) will be greatly appreciated!!!
Thanks you all in advance! Don
Hi Curt,
Thanks for the quick reply! I have some functions which are logical enough
to put them into one class and some "ad-hoc" functions and variables that
many pages in my website (Not All) needed.
So any ideas? (Also any pointers to tutorials or step-by-step for the
recommended method?)
Cheers!
Don
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Both methods will work for you. Inheritance may be the easiest to use and the simplist but it will depend a bit on what you are doing. If these are simple functions then the page is great. If they are larger it might be easier to place them into a class and call it when needed. I tend to use a combination. I have inherited pages, inherited classes and seperate files sometimes all within the same app. I know that's not quite what you wanted to hear but without specifically seeing your usage it's the best I can
say.
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"Don Wash" <do*@wash.com > wrote in message news:uP******** *****@TK2MSFTNG P12.phx.gbl... Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is VB6 and ASP3. Right now, I'm evaluating strategies on creating reusable and
common functions and methods for ASP.NET. In ASP 3, it was nothing more than functions and methods coded in #Include Files. Now ASP.NET offers
features such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that can
be reused (i.e called it) in 10 different ASPX pages, what do I do? Do I create a model page which contains the classes and inherit them? Or do I just create a VB file containing all the functions and I can call the
functions from other ASPX pages once I compile them? Or do I create ASCX web controls? But right now, basically all I need to do is the code only reusable component and no UI.
Please advice on the best method to create reusable functions and
methods segments for ASP.NET. Also URL pointers on explaining step-by-step procedures on recommended method(s) will be greatly appreciated!!!
Thanks you all in advance! Don
I'd probably go with page inheritance in your case.
Simple enough. Just put all these functions in the code on one master page
that derives from the standard page class.
Then on all your pages in the code add your "master" as the class you
inherit from instead of the Page class.
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Don Wash" <do*@wash.com > wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl... Hi Curt,
Thanks for the quick reply! I have some functions which are logical enough to put them into one class and some "ad-hoc" functions and variables that many pages in my website (Not All) needed.
So any ideas? (Also any pointers to tutorials or step-by-step for the recommended method?)
Cheers! Don
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Both methods will work for you. Inheritance may be the easiest to use
and the simplist but it will depend a bit on what you are doing. If these
are simple functions then the page is great. If they are larger it might be easier to place them into a class and call it when needed. I tend to use
a combination. I have inherited pages, inherited classes and seperate
files sometimes all within the same app. I know that's not quite what you
wanted to hear but without specifically seeing your usage it's the best I can say.
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"Don Wash" <do*@wash.com > wrote in message news:uP******** *****@TK2MSFTNG P12.phx.gbl... Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is
VB6 and ASP3. Right now, I'm evaluating strategies on creating reusable and
common functions and methods for ASP.NET. In ASP 3, it was nothing more than functions and methods coded in #Include Files. Now ASP.NET offers features such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that
can be reused (i.e called it) in 10 different ASPX pages, what do I do? Do I
create a model page which contains the classes and inherit them? Or do I just create a VB file containing all the functions and I can call the functions from other ASPX pages once I compile them? Or do I create ASCX web controls? But right now, basically all I need to do is the code only reusable component and no UI.
Please advice on the best method to create reusable functions and methods segments for ASP.NET. Also URL pointers on explaining step-by-step procedures on recommended method(s) will be greatly appreciated!!!
Thanks you all in advance! Don
You can also just create static functions
eg
public class ConstantFunctio ns
{
public static void SetSelectedItem (ref
System.Web.UI.W ebControls.Drop DownList oDrop, string val)
{
System.Web.UI.W ebControls.List Item li = oDrop.Items.Fin dByValue(val);
if (li == null)
{
oDrop.SelectedI ndex = 0;
}
else
{
li.Selected = true;
}
}
}
"Don Wash" <do*@wash.com > wrote in message
news:uP******** *****@TK2MSFTNG P12.phx.gbl... Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is VB6
and ASP3. Right now, I'm evaluating strategies on creating reusable and common functions and methods for ASP.NET. In ASP 3, it was nothing more than functions and methods coded in #Include Files. Now ASP.NET offers features such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that can be reused (i.e called it) in 10 different ASPX pages, what do I do? Do I
create a model page which contains the classes and inherit them? Or do I just create a VB file containing all the functions and I can call the functions from other ASPX pages once I compile them? Or do I create ASCX web
controls? But right now, basically all I need to do is the code only reusable component and no UI.
Please advice on the best method to create reusable functions and methods segments for ASP.NET. Also URL pointers on explaining step-by-step procedures on recommended method(s) will be greatly appreciated!!!
Thanks you all in advance! Don
"Don Wash" <do*@wash.com > wrote in
news:uP******** *****@TK2MSFTNG P12.phx.gbl: Or do I just create a VB file containing all the functions and I can call the functions from other ASPX pages once I compile them?
This will probably be the easiest method. Create a VB Class which you can
use in other pages.
--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying. http://members.ebay.com/aboutme/coolspot18/
Wait for VS2005 which has the master page concept with content placeholders,
and web parts for portal development.
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
Time flies when you don't know what you're doing
"Don Wash" <do*@wash.com > wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl... Hi Curt,
Thanks for the quick reply! I have some functions which are logical enough to put them into one class and some "ad-hoc" functions and variables that many pages in my website (Not All) needed.
So any ideas? (Also any pointers to tutorials or step-by-step for the recommended method?)
Cheers! Don
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Both methods will work for you. Inheritance may be the easiest to use
and the simplist but it will depend a bit on what you are doing. If these
are simple functions then the page is great. If they are larger it might be easier to place them into a class and call it when needed. I tend to use
a combination. I have inherited pages, inherited classes and seperate
files sometimes all within the same app. I know that's not quite what you
wanted to hear but without specifically seeing your usage it's the best I can say.
-- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com
"Don Wash" <do*@wash.com > wrote in message news:uP******** *****@TK2MSFTNG P12.phx.gbl... Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is
VB6 and ASP3. Right now, I'm evaluating strategies on creating reusable and
common functions and methods for ASP.NET. In ASP 3, it was nothing more than functions and methods coded in #Include Files. Now ASP.NET offers features such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that
can be reused (i.e called it) in 10 different ASPX pages, what do I do? Do I
create a model page which contains the classes and inherit them? Or do I just create a VB file containing all the functions and I can call the functions from other ASPX pages once I compile them? Or do I create ASCX web controls? But right now, basically all I need to do is the code only reusable component and no UI.
Please advice on the best method to create reusable functions and methods segments for ASP.NET. Also URL pointers on explaining step-by-step procedures on recommended method(s) will be greatly appreciated!!!
Thanks you all in advance! Don
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Matt |
last post by:
I have object/machine code in static library (written and compiled
using C++) that I wish to make difficult to reverse-engineer. I am
told by others that some could reverse-engineer this object/machine
code to generate some or all of the source, and while it may not be a
trivial task, it would not be impossible.
Do tools, processes, or other means exist by which I could do this?
I'm looking for something analogous to code obfuscation...
|
by: BigMan |
last post by:
I've come to the decision to use multiple namespaces for a very
specific reason:
I like to use descriptive names of UDTs and I sometimes come up with
long UDT names (and file names too, since I name a source file after
the UDT that is defined in it, if any).
I've also noticed, however, that certain types are related more than
logically but also lexically - they start with the same word (which
happens to be the basic concept that they...
|
by: Rada Chirkova |
last post by:
Hi,
at NC State University, my students and I are working on a project called
"self-organizing databases," please see description below. I would like to
use an open-source database system for implementation and would really
appreciate your opinion on whether PostgreSQL is suitable for the project.
In general, I am very impressed by the quality of PostgreSQL code and
documentation, as well as by the support of the developer community.
...
|
by: Don Wash |
last post by:
Hi All!
I'm developing ASP.NET pages using VB.NET language. My background is VB6 and
ASP3. Right now, I'm evaluating strategies on creating reusable and common
functions and methods for ASP.NET. In ASP 3, it was nothing more than
functions and methods coded in #Include Files. Now ASP.NET offers features
such as Page Inheritance and full software development support.
So I'm just wondering, what should I do if I have 5 functions, that...
|
by: wrecker |
last post by:
Hi all,
I have a few common methods that I need to use at different points in
my web application. I'm wondering where the best place would be to
put these? I think that I have three options.
1. I can create a common module like common.vb in my project and put
all the functions in there.
2. Create a utility class and create the common functions as shared
| |
by: Ray Dukes |
last post by:
What I am looking to do is map the implementation of interface
properties and functions to an inherited method of the base class.
Please see below.
'****************************************************************************
' Issues
'****************************************************************************
|
by: CES |
last post by:
All,
I was wondering if someone could point me to a tutorial on creating & accessing functions from within a wrapper function.
I've created a group of functions related to a timer event. All works well until I try to enclose these functions into a class like structure ie:
function dTimer(div){
//Insert the Javascript Code Below
startTimer();
}
|
by: Tony |
last post by:
And that is probably very unclear - so let me explain. Please forgive me
if I screw up the terminology (and let me know what the correct term
would be):
What I want to do is to create a library 'namespace' to encapsulate
certain functions that have something in common. I want it to work in
the way the Math() object works - by calling it directly, instead of
having to instantiate it as a variable (object?)
For example, with the Math...
|
by: Brian Blais |
last post by:
Hello,
I am trying to organize some of my code, and am having a little trouble with the
import logic. I find I often have something like:
MyPackage/
Part1/ # wants to use functions in Common/
__init__.py # does "from MyClass1 import MyClass1", etc,...
MyClass1.py
MyClass1a.py # depends on MyClass1
|
by: bukzor |
last post by:
I've been finding at work that I've written a set of functions several
times, sometimes with more or less features or bugs, so I've decided
to take my small, useful functions and put them in some common place.
I've made a module for this, but it is quickly becoming a jumbled mess
of unrelated functions. Also the one class that I've written with
inheritance takes up fully 1/3 of the documentation (compared to 20
other functions). Since this...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |