Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2003, 04:42 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I just started a new topic that is somewhat related to a few things discussed here.

http://p2p.wrox.com/topic.asp?TOPIC_ID=3383

peter
 
Old August 26th, 2003, 07:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Quote:
quote:Originally posted by planoie
 Yes and no. ;) The whole concept of #include has been abandoned. Because of the way .Net works, you now can access all your helper functions/classes/etc from anywhere in the namespace hierarchies. Of course, many people's use of include files was for layout. .Net's (poor IMHO) solution to this is user controls.

I just did a test in VS.Net. I created an ASPX file with no code-behind. It looked like this...
Code:
<%
Dim sTestString as String = "Junk test string"
Response.Write("This is coming from the include file.")
Response.Write(sTestString)
%>
Then I created an ASP file.
Code:
<%
Response.Write("This is coming from the include file.")
Response.Write(sTestString)
%>
I then added these lines to an existing aspx webform...
Code:

It worked!

So I guess the technically accurate answer is: Yes you can still do includes. And you seem to be able to mix them up between ASP and ASPX. But, you really shouldn't do this. Given that an include would need to be an asp/x file that has just inline script in it, you defeat the power and advantage of compilation, intellisense, etc.

What are you intending to do with includes?


I was planning on using includes for layout and I always created a links asp file and included it so I wouldn't have to change links on every page. (I hate frames)

So, can I create a links custom control?
 
Old August 26th, 2003, 08:56 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Yes. You most definitely can create a user control that has all your links in it. Then you just need to place that control on the pages which you want those links to appear.

As far as the issue of using includes for layout, well, that's another issue. There are dozens of topics and discussions here and elsewhere about "site layout" techniques using ASP.Net. Some keywords I have found that have helped me along with my research of this topic include "visual inheritance", "template pages" and "master pages". Do a search for those and see what you find. There are many ways to accomplish this, but I have yet to find one that is really as clean and easy as what I have done in the past with ASP.

Good Luck.
Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Question JEHalm BOOK: Beginning Access VBA 0 December 29th, 2005 10:42 AM
Simple Question dinosaur_uk VB.NET 2002/2003 Basics 1 September 10th, 2004 09:43 AM
Simple Question MSK888 C# 4 August 1st, 2004 12:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.