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 <!-- #include virtual ="header.aspx" -->...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.......
:)

Recommended Answers

All 5 Replies

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.

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

iframe could be an option !

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.