yaniv Posted December 12, 2003 Posted December 12, 2003 so, i have a "index.aspx" page, in the article a read i so something like "drag and drop" the page. what does it mean? let's say that page have my logo on the top, how do i make it to apear in the oter pages? Quote
andycharger Posted December 12, 2003 Posted December 12, 2003 The easiest way to have pages "appear" in other pages is to use include files I find. To do this, make a new page in .net and call it "yourpagename.inc" What you need to put in this page is just the code that contains the images and structure that you want in all pages. using the .Inc extension makes it an include file. you can then call the include file. For example, Imagine you have a very basic page called "index.aspx" Here is the code <%@ Page Language="vb" AutoEventWireup="false" Codebehind="index1.aspx.vb" Inherits="inet1.index"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>index</title> </head> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> </form> </body> </html> Then say you want to put a table in the body of the page, Make a new page with the <table> commands in it: i.e <table> <tr> <td>Hello World</td> </tr> </table> and save this as "yourfilename.inc" Then in your index.aspx code you need to include the file where you want the code to appear. you do this like this <!--#INCLUDE FILE="yourfilename.inc"--> Just insert that tag where you want it to appear! Simple! Andy Quote
Administrators PlausiblyDamp Posted December 12, 2003 Administrators Posted December 12, 2003 You may be better off looking at creating a user control rather than an include file under asp.net. User controls allow you a bit more control over things like caching. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.