HOW TO Use asp Include in ASP.NET ?

M

Marina

If the .asp file happens to contain only things that are valid in asp.net
(i.e. you would be able to convert it to a .aspx just by changing the
extension), then sure.
 
T

Tiraman

Hi ,

can I use an asp (not aspx) file as include in my aspx files ?

lets say that I have a regular asp file that hold few functions , params
(dim x etc ....) and cost's

and i don't want to rewrite this file as aspx so how can i use it in my aspx
files ?

Thanks In Advanced

Tiraman .
 
S

Steven Cheng[MSFT]

Thanks for all your suggestions.

Hi Tiraman,

In ASP.NET it still have its serverside include diretive which help to
embeded some common page template into the asp.net webpage.

#Server-Side Include Directive Syntax
http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconserver-sideinclud
edirectivesyntax.asp?frame=true

However, as for your situation, you have some classic vb script function in
your old include file. I think its better to rewrite it via donet
programming language( just as Andrew has suggest) because vbscript is no
longer the serverside programming language in asp.net. Also, asp.net
provide the UserControl which also help include some reusable page content
or logics in common pages.

#Including a User Control in a Web Forms Page
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconincludingpageletco
ntrolinanotherwebformspage.asp?frame=true

In addition ,here are some other tech articles on the related topics.
#Simulating include Files with an ASP.NET Server Control
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspnet-simulatinginclude
.asp?frame=true

#Migrating to ASP.NET: Key Considerations
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspnetmigrissues.asp?fra
me=true#aspnetmigrissues_intro

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top