473,804 Members | 3,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1264
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******** ********@TK2MSF TNGP10.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******** ******@tk2msftn gp13.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******** ********@TK2MSF TNGP10.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(someStri ng 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******** ******@TK2MSFTN GP10.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******** ******@tk2msftn gp13.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******** ********@TK2MSF TNGP10.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
2513
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 very carefully define the order in which paths are searched with command line options on the compiler. Both can cause problems, especially when dealing with complex software distributions. It occurs ot me that by extending the C include...
7
1547
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 File='file2.htm' -->
3
258
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
2129
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file = ...\includes\StaffingHeaders.inc -->" </Script> <%=ClientName%> ****************************************************************************
4
1820
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 pages in a subsection, e.g. everything in /about/ needs to have <body id="about">. In the past what I've done is set a global variable in index.asp, then include the template to render the page: <% pageid = "about"
5
241
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, or something else?
10
3098
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 config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
0
1258
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 the top left corner of my screen. More importantly, I cannot move it around. What properties/methods do I need to implement to allow: 1. the user to move the dialog around? 2. create borders that include the normal options of minimizing (-)...
11
26648
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 and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
0
9708
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, 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...
0
10589
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, 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...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
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();...
1
4302
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
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
bsmnconsultancy
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...

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.