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
Printable View
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
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:
The user contol looks 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>
At run time the page's source will combine the two (or more) files to look like this:Code:<%@ Control Language="VB" %>
<p>
This is just a simple version of a user control (.aspx).
</p>
I hope that is somewhat helpful to you.Code:<html>
<head>
<title>Sample Control</title>
</head>
<body>
<p>
This is just a simple version of a user control (.aspx).
</p>
</body>
</html>
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