Results 1 to 3 of 3

Thread: how to include one asp.net page into another like asp??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70

    how to include one asp.net page into another like asp??

    Hi,

    How can we include one asp.net page into another asp.net page OR can we include one asp.net page into another asp page like how we do in asp... Is there a possibility to do that???
    Thanks for the replies in advance

  2. #2
    Hyperactive Member
    Join Date
    Apr 2003
    Location
    Three Rivers, MI
    Posts
    354
    Are you just trying to do an include file? If, for instance, you wanted to put navigation in one file and use it on all your files you can do that with a user control.

    Here is a real basic example of a user contol. I have two files. One called default.aspx and the other uc_include.ascx (user Contols have an ascx extension).

    The default file would look like this:
    Code:
    <%@ Page Language="VB" %>
    <%@ Register TagPrefix="myControl" TagName="aControl" Src="uc_include.ascx" %>
    <html>
    <head>
    <title>Sample Control</title>
    </head>
    <body>
        <myControl:aControl id="aControl" runat="server"></myControl:aControl>
    </body>
    </html>
    The user contol looks like this:
    Code:
    <%@ Control Language="VB" %>
    <p>
        This is just a simple version of a user control (.aspx). 
    </p>
    At run time the page's source will combine the two (or more) files to look like this:
    Code:
    <html>
    <head>
    <title>Sample Control</title>
    </head>
    <body>
    <p>
        This is just a simple version of a user control (.aspx). 
    </p>
    </body>
    </html>
    I hope that is somewhat helpful to you.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70
    Thanks for ur reply...

    Can we just try to do an include file like how we do in classic asp...
    I know we cannot include one asp.net into another asp.net page like the class one....

    But can we just use the include tag to include the asp.net page into an asp page

    Actually I got two separate asp files and two separate asp.net files can I just include all of them in one asp file.......Help will be appreciated

    Thanks for the replies
    Last edited by cooldudeattitud; Feb 21st, 2004 at 02:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width