开发者

show an aspx page in content tag

开发者 https://www.devze.com 2022-12-11 03:41 出处:网络
I have a开发者_StackOverflow master page(MyMasterPage.master) with two content place holders. I wanna show another aspx page(MyHeader.aspx) in the 1st content place holder of a content page(MyContentP

I have a开发者_StackOverflow master page(MyMasterPage.master) with two content place holders. I wanna show another aspx page(MyHeader.aspx) in the 1st content place holder of a content page(MyContentPage.aspx) that uses my master page.


You should be using user controls for reusable components of a pages. Create a Header.ascx file instead of a .aspx. You can then drag that into your ContentPlaceHolder from the solution explorer when in design mode.

http://msdn.microsoft.com/en-us/library/y6wb1a0e.aspx


I would use UserControls. MyHeader.ascx.


I echo the prior commenter's suggestion to use a usercontrol if possible.

If you really want to keep your existing aspx page; you might want to take a look at using an IFrame to accomplish this.

0

精彩评论

暂无评论...
验证码 换一张
取 消