473,387 Members | 1,673 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,387 software developers and data experts.

Move From Include Files to User Control

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.
Nov 19 '05 #1
3 1243
Wayne:
The question was asked earlier today by someone else. Kevin and I answered
it and I think you'll find the answer useful to your situation, take a look:
http://groups.google.ca/groups?hl=en...gbl%26rnum%3D1

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.

Nov 19 '05 #2
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

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Oh**************@tk2msftngp13.phx.gbl...
Wayne:
The question was asked earlier today by someone else. Kevin and I answered it and I think you'll find the answer useful to your situation, take a look: http://groups.google.ca/groups?hl=en...gbl%26rnum%3D1
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.


Nov 19 '05 #3
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:uD**************@TK2MSFTNGP10.phx.gbl...
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

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Oh**************@tk2msftngp13.phx.gbl...
Wayne:
The question was asked earlier today by someone else. Kevin and I

answered
it and I think you'll find the answer useful to your situation, take a

look:

http://groups.google.ca/groups?hl=en...gbl%26rnum%3D1

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
> 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.
>
>



Nov 19 '05 #4

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

Similar topics

5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
7
by: Andre | last post by:
I want to condition what include files are included in an web page (.aspx). Something like: if (condition1) { <!-- #Include File='file1.htm' --> } else if (condition2) { <!-- #Include...
3
by: Manny Chohan | last post by:
Hi guys, I have a asp page and is there any way i can just code with C# to include this asp page as content just like <% include filename %> Manny
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
4
by: Mark | last post by:
I am setting up an asp.net site using the Ektron CMS. Every page in the site uses the same basic template, with the look of the page changing via CSS and an id on the body. The id is shared by all...
5
by: NuB | last post by:
i have an classic asp web app that I'm converting to .NET using C#. The asp app uses about 20 include files on various pages, in the .NET world can i use include files or is it web user controls,...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
0
by: diatom | last post by:
Hello, In a windows application, I just created a new custom user control. This custom user control is simply a dialog that I want to re-use. When my dialog opens, by default it is located in...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.