Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > neewbie : include virtual

Reply
Thread Tools

neewbie : include virtual

 
 
Mark
Guest
Posts: n/a
 
      10-18-2003
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


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      10-18-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Wim Hollebrandse
Guest
Posts: n/a
 
      10-18-2003
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/
 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      10-18-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/



 
Reply With Quote
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      10-18-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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/

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
include virtual in virtual directory? rockdale ASP General 3 09-04-2008 02:36 PM
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
Re: the use of #include <a_file.h> v/s #include"a_file.cpp" Elie Nader C++ 1 11-28-2003 03:12 PM
Re: the use of #include <a_file.h> v/s #include"a_file.cpp" Rolf Magnus C++ 2 11-28-2003 12:26 PM
#include "bar" negates #include <string> ; how to fix? Danny Anderson C++ 5 08-15-2003 06:38 PM



Advertisments