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

neewbie : include virtual

Hi,
Here's what's up:
I have a subroutine getAds () that I possibly will need to call more than
once in a page (and on more than one page). When I have the sub code on the
same page, it works fine.
When I try and move it to a separate page (to consolidate all of the
commonly called ones) and use <!-- include virtual =
"somefolder/somepage.aspx"-->
I get no errors about not being able to find the file, so I'm assuming it's
being included, but when I call getAds() , I get an error saying 'getAds()'
is not declared.
I'm putting the include tag directly after my page directive and my sub
accepts one parameter.
How can I move my commonly called subs to another page and reference them?

Sorry If I'm overlooking something incredibly obvious.

Thanks,
Mark
Nov 17 '05 #1
6 1179
I'm using WebMatrix for the time being, and I (maybe incorrectly) am under
the impression that it does not support code behind.
I'll take your advice, (although I've been able to get the include files
working) and read up on your ideas. Anyone know of a good tutorial?
"Wim Hollebrandse" <wim@-NOSPAM-wimdows.net> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
Totally agree with Steve there.

User controls offer so much more than include files. You can expose properties for your user control and access these from codebehind pages.
Also - user controls can be cached; something called 'partial caching'.

Hope that helps.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/

Nov 17 '05 #2
These articles should give you a good start:
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ebControls.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Mark" <py*******@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
I'm using WebMatrix for the time being, and I (maybe incorrectly) am under
the impression that it does not support code behind.
I'll take your advice, (although I've been able to get the include files
working) and read up on your ideas. Anyone know of a good tutorial?
"Wim Hollebrandse" <wim@-NOSPAM-wimdows.net> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
Totally agree with Steve there.

User controls offer so much more than include files. You can expose

properties for your user control and access these from codebehind pages.

Also - user controls can be cached; something called 'partial caching'.

Hope that helps.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/


Nov 17 '05 #3
Include files are old fashioned.
In ASP.NET you have better options, such as web user controls (for shared
visual elements), or putting all your shared code into one or more common
classes.
You'll be a better developer if you point yourself toward these more object
oriented solutions.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Mark" <py*******@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
Hi,
Here's what's up:
I have a subroutine getAds () that I possibly will need to call more than
once in a page (and on more than one page). When I have the sub code on the same page, it works fine.
When I try and move it to a separate page (to consolidate all of the
commonly called ones) and use <!-- include virtual =
"somefolder/somepage.aspx"-->
I get no errors about not being able to find the file, so I'm assuming it's being included, but when I call getAds() , I get an error saying 'getAds()' is not declared.
I'm putting the include tag directly after my page directive and my sub
accepts one parameter.
How can I move my commonly called subs to another page and reference them?

Sorry If I'm overlooking something incredibly obvious.

Thanks,
Mark

Nov 17 '05 #4
Totally agree with Steve there.

User controls offer so much more than include files. You can expose properties for your user control and access these from codebehind pages.

Also - user controls can be cached; something called 'partial caching'.

Hope that helps.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #5
I'm using WebMatrix for the time being, and I (maybe incorrectly) am under
the impression that it does not support code behind.
I'll take your advice, (although I've been able to get the include files
working) and read up on your ideas. Anyone know of a good tutorial?
"Wim Hollebrandse" <wim@-NOSPAM-wimdows.net> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
Totally agree with Steve there.

User controls offer so much more than include files. You can expose properties for your user control and access these from codebehind pages.
Also - user controls can be cached; something called 'partial caching'.

Hope that helps.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/

Nov 17 '05 #6
These articles should give you a good start:
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ebControls.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Mark" <py*******@hotmail.com> wrote in message
news:vp************@corp.supernews.com...
I'm using WebMatrix for the time being, and I (maybe incorrectly) am under
the impression that it does not support code behind.
I'll take your advice, (although I've been able to get the include files
working) and read up on your ideas. Anyone know of a good tutorial?
"Wim Hollebrandse" <wim@-NOSPAM-wimdows.net> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
Totally agree with Steve there.

User controls offer so much more than include files. You can expose

properties for your user control and access these from codebehind pages.

Also - user controls can be cached; something called 'partial caching'.

Hope that helps.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/


Nov 17 '05 #7

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

Similar topics

7
by: jason | last post by:
I am getting twisted by the possibility that my virtual includes which currently work great on non-domain remote IP will crash if I purchase a domain and point it to one of my designated...
3
by: Zenobia | last post by:
I copy an application to wwwroot: wwwroot +--- myApp +--- common | +--- images | default.asp global.asa
9
by: JR | last post by:
Hi, I'm migrating my website to an IIS 6.0 server and all the asp pages work fine except for the ones that reference include files, even though I have "Enable parent paths" enabled in the...
2
by: Mark | last post by:
Hi, Here's what's up: I have a subroutine getAds () that I possibly will need to call more than once in a page (and on more than one page). When I have the sub code on the same page, it works...
8
by: Alex | last post by:
Hi, I have noticed that in an aspx page <!--#include virtual="Home.htm"--> acts the same as <!--#include File="Home.htm"--> when I am NOT in the root diectory of the site (I am aware that...
2
by: Kraai | last post by:
in normal asp , and even php i could use the <!--#include file="login.aspx" --> or <!--#include virtual="login.aspx" --> to include pages in my main page without using frames! when i try...
10
by: Eric | last post by:
Hello, I have some server side includes on a Classic asp page that look something like: <!-- #include virtual="/includes/file1.asp"--> <!-- #include virtual="/includes/file2.asp" --> <!--...
6
by: Jordi | last post by:
I'm having a problem which I think has to do with the circular use of inlcuding header files. The short version of my code would look a bit like this, I think: GameEngine.h: #ifndef GAME_ENGINE...
5
by: chris_peoples | last post by:
I have a virtual directory, lets say it exists at www.server-a.com/virtual-dir/ virtual-dir points to another directory on another server using the unc path: \\server-b\main-dir I have a file at...
5
by: rockdale | last post by:
Hi, all: Hope somebody can solve this problem for me. We are migrating 3 asp website into IIS 6.0 on a server 2003. we do not want to create 3 website since we do not want to acquire different...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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,...
0
jinu1996
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...
0
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...
0
tracyyun
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...

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.