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

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

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
Nov 18 '05 #1
3 1259
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" <an*******@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
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

Nov 18 '05 #2
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" <an*******@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
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
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
Nov 18 '05 #3

"Ben" <an*******@discussions.microsoft.com> wrote in message news:AF**********************************@microsof t.com...
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
Nov 18 '05 #4

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

Similar topics

3
by: Rainbow News Service | last post by:
http://www.php.net/manual/en/install.windows.manual.php says: Copy your chosen ini-file to a directory that PHP is able to find and rename it to php.ini. PHP searches for php.ini in the following...
111
by: Retlak | last post by:
The recommended (on dozens of websites) and effective (works in Netscape, MSIE, Mozilla, probably others) way to detect if a browser has Javascript turned off is to put this in the <head>: ...
0
by: jbeerni | last post by:
In .NET, you can mark methods and accessors as obsolete by using the directive. I've found some interesting behavior with the directive when used in a class which is referenced as a return type...
2
by: trying_to_learn | last post by:
im in the primary stages of learning C++. The book im learning from says Dont use using namespace.. directive in header file However im trying to make the following header file.I need to include...
2
by: Mantorok Redgormor | last post by:
what is the purpose of the #line directive? how is it suppose to be used? I didn't see it mentioned in the faq and I can't make any sense of it from the standard. -- nethlek
5
by: Jim Heavey | last post by:
Is the Page directive only go on ".aspx" pages? I think the answer is yes, but I am not positive. I am trying to figure out why a called class can not be found and I was wondering if I should...
2
by: rjack | last post by:
I'm using VS 2005 Beta 2. In VS 2003, the Page directive in an aspx page has Language and CodeBehind attributes. You can have the language be different than the code behind file language. For...
1
by: Poppy | last post by:
I opened an asp page in VS.net 2002 and then saved it as an aspx page. I was prompted if I wanted to create the class file for the page and clicked yes. Now when I try and open the page I get...
5
by: Francois Grieu | last post by:
One of the C compiler that I use <OT>(Keil's CX51)</OTbarks at #define a(b) b int main(void){return a( #if 0 #endif 0);} More generally, this compiler seems confused by any preprocessing...
2
by: aleemakhtar1 | last post by:
wat is use of pragma directive in embedded sys ??
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.