Move From Include Files to User Control

W

Wayne Wengert

I am rewriting some ASP pages to move them to ASP.NET (VB). The old pages
had some include files such as one that had the subroutine to create a
connection as well as the code that invoked that sub.

My understanding (never tried a user control before so I may well have this
screwed up) is that if I create a user control (I use VSNET 2003) I can then
put the SUBs in the main section of the code=behind and I am guessing that I
put the code I want executed where the control is invoked, into the Page
Load of the user control?

Any pointers to some examples a beginner can understand will be much
appreciated

Wayne

p.s. I tried to post this several hours ago but it never appeared in the NG
so I am trying again. If both posts appear I apologize.
 
W

Wayne Wengert

Thanks for the response. The other thread seemed to be about constants. I
want to "include" subroutines and code like I used to do with an Include
File

Wayne
 
K

Karl Seguin

it's the same principal:

public class Utility
public shared function Format(someString as string) as string
return "aa"
end if
end class


and then you can use Utility.Format("aa")

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top