Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Utilities File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 04 Dec 2007 02:46 GMT
Hi,

     I want to add a .vb file to my project that contains some
utility functions that will be re-used by different pages within the
project.

     When I go to Add New Item, it offers me a Class file - which is
essentially a blank .vb file with some class syntax framework in it.
But what if I don't want a class, what if I just want a file that will
hold some public functions and subs that can be accessed from the vb
code-behind modules in the project.

     I am trying to achieve some low-tech re-use.   No inheritance,
just some publicly available functions.   This should be fairly easy,
but it seems like VS is always looking for a class.

     Can someone tell me how to achieve this?

J
Mark Rae [MVP] - 04 Dec 2007 02:54 GMT
> Can someone tell me how to achieve this?

Declare the methods in the class as Public Shared - then you can access then
without having to instantiate the class...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.