Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is there an '<!--#include...' directive in .NET?

Reply
Thread Tools

Is there an '<!--#include...' directive in .NET?

 
 
=?Utf-8?B?bGl0dGxlY2hhcnZh?=
Guest
Posts: n/a
 
      05-11-2004
Hi

I'm trying to write a webpage in ASP.NET using code behind. My code behind page works fine, but now I want to create an instance of an object who's class is stored in a different file. In ASP I've have just used the old <!--#include virtual="file.asp"-->, surely there's something similar I can use in my .cs file

BTW, I'm not using Visual Studio

Cheers

littlecharva
 
Reply With Quote
 
 
 
 
avnrao
Guest
Posts: n/a
 
      05-11-2004
User Controls in .Net are similar to #include in asp. try converting your
code behind and html content to a user control.
check this article :
http://support.microsoft.com/default...Product=aspnet

Av.

"littlecharva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm trying to write a webpage in ASP.NET using code behind. My code
> behind page works fine, but now I want to create an instance of an object
> who's class is stored in a different file. In ASP I've have just used the
> old <!--#include virtual="file.asp"-->, surely there's something similar I
> can use in my .cs file?
>
> BTW, I'm not using Visual Studio.
>
> Cheers,
>
> littlecharva



 
Reply With Quote
 
 
 
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      05-11-2004
Another article on User Controls that I'd encourage you to read is:

An Extensive Examination of User Controls
http://msdn.microsoft.com/asp.net/us...ercontrols.asp

Happy Programming!


avnrao wrote:
> User Controls in .Net are similar to #include in asp. try converting your
> code behind and html content to a user control.
> check this article :
> http://support.microsoft.com/default...Product=aspnet
>
> Av.
>
> "littlecharva" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>Hi,
>>
>>I'm trying to write a webpage in ASP.NET using code behind. My code
>>behind page works fine, but now I want to create an instance of an object
>>who's class is stored in a different file. In ASP I've have just used the
>>old <!--#include virtual="file.asp"-->, surely there's something similar I
>>can use in my .cs file?
>>
>>BTW, I'm not using Visual Studio.
>>
>>Cheers,
>>
>>littlecharva

>
>
>



--

Scott Mitchell
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
Reply With Quote
 
Hans Kesting
Guest
Posts: n/a
 
      05-12-2004

"Ben" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> If you're just instantiating a class, you don't need to physically reference a file as long as the file that class is in is also

in the same project as your web page. Once compiled, you can create an instance of that class in any of your web pages.

It *is* possible to use classes from different projects: you need to add a "reference" to your *project*
(not to the specific aspx/ascx)
this reference can point to the project that contains the classes you want to use
(if that project is in the same solution) or to the physical dll that contains those classes.

Hans Kesting


 
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
There can be only one 'page' directive Poppy ASP .Net 3 07-10-2007 11:14 PM
There can be only one page directive Jay ASP .Net 0 04-27-2004 08:29 PM
The 'Location' attribute is not supported by the 'OutPutCache' directive????when i set in the directive .NET Follower ASP .Net 1 02-13-2004 10:32 AM
Pgae Directive Jim Heavey ASP .Net 4 10-18-2003 04:00 AM
enablesessionstate Page directive is needed to use the Session object Marco Gerlach ASP .Net 2 07-18-2003 10:27 AM



Advertisments