PC Review


Reply
Thread Tools Rating: Thread Rating: 3 votes, 1.00 average.

ASP.NET Includes Text or HTML Files into ASPX pages

 
 
Bari
Guest
Posts: n/a
 
      11th Dec 2003
I'm trying to find out how to INCLUDE a file (text or html
etc) into my ASPX page.
I don't want to know how to create a user control etc just
a quick simple example.

Looking for something similar to the old fashioned ASP
include <!--#include file="time.inc"--> but a .NET version.

 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      11th Dec 2003

"Bari" <(E-Mail Removed)> wrote in message
news:030701c3c033$063a8770$(E-Mail Removed)...
> I'm trying to find out how to INCLUDE a file (text or html
> etc) into my ASPX page.
> I don't want to know how to create a user control etc just
> a quick simple example.
>
> Looking for something similar to the old fashioned ASP
> include <!--#include file="time.inc"--> but a .NET version.
>



Hmmm, UserControls ARE the .NET version of how this is done, yet you DON'T
want that?!

Could you tell me how to put 10 gallons of water into a 5 gallon bucket all
at once please?


 
Reply With Quote
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      12th Dec 2003
Traditional #include is nit really a good option for the OO nature of
asp.net. The correct approach is to use user controls, but they can be very
simple to implement.

Add this line to the top of your aspx page
includeme.ascx is the equivalent of the old include file with your HTML
etc, in my case it is a navigation menu

<%@ Register TagPrefix="myProject" TagName="includedthing"
Src="includeme.ascx" %>

To position the include file in the page add the line below to you ASPX
page

<myProject:menu:includedthing ID="myfirstinclude" runat="server" />

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Bari" <(E-Mail Removed)> wrote in message
news:030701c3c033$063a8770$(E-Mail Removed)...
> I'm trying to find out how to INCLUDE a file (text or html
> etc) into my ASPX page.
> I don't want to know how to create a user control etc just
> a quick simple example.
>
> Looking for something similar to the old fashioned ASP
> include <!--#include file="time.inc"--> but a .NET version.
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      12th Dec 2003
Or better yet, in VS.NET, just drag the UserControl (.ascx file) on to the
host page at the desired location and you are done!


"John Timney (Microsoft MVP)" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Traditional #include is nit really a good option for the OO nature of
> asp.net. The correct approach is to use user controls, but they can be

very
> simple to implement.
>
> Add this line to the top of your aspx page
> includeme.ascx is the equivalent of the old include file with your HTML
> etc, in my case it is a navigation menu
>
> <%@ Register TagPrefix="myProject" TagName="includedthing"
> Src="includeme.ascx" %>
>
> To position the include file in the page add the line below to you ASPX
> page
>
> <myProject:menu:includedthing ID="myfirstinclude" runat="server" />
>
> --
> Regards
>
> John Timney (Microsoft ASP.NET MVP)
> ----------------------------------------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> ----------------------------------------------
>
> "Bari" <(E-Mail Removed)> wrote in message
> news:030701c3c033$063a8770$(E-Mail Removed)...
> > I'm trying to find out how to INCLUDE a file (text or html
> > etc) into my ASPX page.
> > I don't want to know how to create a user control etc just
> > a quick simple example.
> >
> > Looking for something similar to the old fashioned ASP
> > include <!--#include file="time.inc"--> but a .NET version.
> >

>
>



 
Reply With Quote
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      12th Dec 2003
that would indeed do it in vs.net..........(old hardcore developers like me
like to do it the old fashioned way - notepad and the SDK )

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Scott M." <s-(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Or better yet, in VS.NET, just drag the UserControl (.ascx file) on to the
> host page at the desired location and you are done!
>
>
> "John Timney (Microsoft MVP)" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Traditional #include is nit really a good option for the OO nature of
> > asp.net. The correct approach is to use user controls, but they can be

> very
> > simple to implement.
> >
> > Add this line to the top of your aspx page
> > includeme.ascx is the equivalent of the old include file with your HTML
> > etc, in my case it is a navigation menu
> >
> > <%@ Register TagPrefix="myProject" TagName="includedthing"
> > Src="includeme.ascx" %>
> >
> > To position the include file in the page add the line below to you ASPX
> > page
> >
> > <myProject:menu:includedthing ID="myfirstinclude" runat="server" />
> >
> > --
> > Regards
> >
> > John Timney (Microsoft ASP.NET MVP)
> > ----------------------------------------------
> > <shameless_author_plug>
> > Professional .NET for Java Developers with C#
> > ISBN:1-861007-91-4
> > Professional Windows Forms
> > ISBN: 1861005547
> > Professional JSP 2nd Edition
> > ISBN: 1861004958
> > Professional JSP
> > ISBN: 1861003625
> > Beginning JSP Web Development
> > ISBN: 1861002092
> > </shameless_author_plug>
> > ----------------------------------------------
> >
> > "Bari" <(E-Mail Removed)> wrote in message
> > news:030701c3c033$063a8770$(E-Mail Removed)...
> > > I'm trying to find out how to INCLUDE a file (text or html
> > > etc) into my ASPX page.
> > > I don't want to know how to create a user control etc just
> > > a quick simple example.
> > >
> > > Looking for something similar to the old fashioned ASP
> > > include <!--#include file="time.inc"--> but a .NET version.
> > >

> >
> >

>
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      13th Dec 2003
I am also an "old hardcore", "Visual" Notepad using developer, but if I can
find a way for VS to generate the exact same (emphasis on "exact same") code
that I would have had to have written, I'll take it!


"John Timney (Microsoft MVP)" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> that would indeed do it in vs.net..........(old hardcore developers like

me
> like to do it the old fashioned way - notepad and the SDK )
>
> --
> Regards
>
> John Timney (Microsoft ASP.NET MVP)
> ----------------------------------------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> ----------------------------------------------
>
> "Scott M." <s-(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > Or better yet, in VS.NET, just drag the UserControl (.ascx file) on to

the
> > host page at the desired location and you are done!
> >
> >
> > "John Timney (Microsoft MVP)" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > Traditional #include is nit really a good option for the OO nature of
> > > asp.net. The correct approach is to use user controls, but they can

be
> > very
> > > simple to implement.
> > >
> > > Add this line to the top of your aspx page
> > > includeme.ascx is the equivalent of the old include file with your

HTML
> > > etc, in my case it is a navigation menu
> > >
> > > <%@ Register TagPrefix="myProject" TagName="includedthing"
> > > Src="includeme.ascx" %>
> > >
> > > To position the include file in the page add the line below to you

ASPX
> > > page
> > >
> > > <myProject:menu:includedthing ID="myfirstinclude" runat="server" />
> > >
> > > --
> > > Regards
> > >
> > > John Timney (Microsoft ASP.NET MVP)
> > > ----------------------------------------------
> > > <shameless_author_plug>
> > > Professional .NET for Java Developers with C#
> > > ISBN:1-861007-91-4
> > > Professional Windows Forms
> > > ISBN: 1861005547
> > > Professional JSP 2nd Edition
> > > ISBN: 1861004958
> > > Professional JSP
> > > ISBN: 1861003625
> > > Beginning JSP Web Development
> > > ISBN: 1861002092
> > > </shameless_author_plug>
> > > ----------------------------------------------
> > >
> > > "Bari" <(E-Mail Removed)> wrote in message
> > > news:030701c3c033$063a8770$(E-Mail Removed)...
> > > > I'm trying to find out how to INCLUDE a file (text or html
> > > > etc) into my ASPX page.
> > > > I don't want to know how to create a user control etc just
> > > > a quick simple example.
> > > >
> > > > Looking for something similar to the old fashioned ASP
> > > > include <!--#include file="time.inc"--> but a .NET version.
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
how can i convert aspx pages to HTML pages. ramya.salva@gmail.com Microsoft C# .NET 2 28th Sep 2007 03:02 PM
html forms in aspx pages thersitz Microsoft ASP .NET 7 18th Jan 2007 12:14 PM
URGENT: Process html pages as aspx pages. jainamber@gmail.com Microsoft ASP .NET 1 31st Oct 2006 09:27 PM
Display html pages within an aspx page =?Utf-8?B?Um9iZXJ0?= Microsoft ASP .NET 1 13th Apr 2004 10:16 AM
displaying .aspx pages as .html page crombie Microsoft Dot NET 1 28th Jan 2004 01:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:33 AM.