954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

calling an aspx page in another aspx page

hello all,
i am using asp.net and while designing my page i want to call another aspx page in my current page.....i.e. in my current page (ex. p1.aspx) ,i want to add a header let it be header.aspx. how can i call that header page in p1.aspx????

actually i want to do some dynamic stuff in that header page so instead of using HTML i am going for aspx....i have used the command ...but i am getting the error as "there can be one page directive "...

plz help me how to call an aspx from another aspx page?

thanx in advance.......
:)

pranab2302
Newbie Poster
3 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

It depends on what kind of a functionality you require in the second aspx (the one you are calling).

If you are just trying to create a dynamic header, you can try looking at user controls.

If you still want to pursue with a complete embedded page, you can use Iframes for the purpose.

bala24
Junior Poster
125 posts since Oct 2006
Reputation Points: 15
Solved Threads: 11
 

In PHP we using include() we include any php page , method is given below

<?php
include("path/pagename.php");
?>

as this type we can insert one page in another page

engg.krishna
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

iframe could be an option !

dnanetwork
Practically a Master Poster
Banned
633 posts since May 2008
Reputation Points: 28
Solved Threads: 106
 

Try using asp.net master pages to achieve your effect.But all the same clientside technologies are best for effects, browser has the final word anyway.

Sarama2030
Junior Poster in Training
74 posts since May 2009
Reputation Points: 10
Solved Threads: 4
 

Using a master page will allow you to define the overall structure for the pages, and set a default header for all pages, that you can then change on a page to page basis, if you so choose.

I'm trying my best to stay to the strict versions of the HTML and XHTML standards, and last I looked, iFrames aren't approved anymore.

Fortinbra
Posting Whiz in Training
240 posts since Jan 2011
Reputation Points: 47
Solved Threads: 12
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You