在母版页中显示页面 [英] displaying page in master page
问题描述
我正在使用asp.net,C#,VS 2005,sql server 2005 ..
我有一个已经设计和编码的.aspx页面...
现在我的问题是我正在使用母版页....
我有一个具有以下内容的母版页:
content1和content2 ...
在content1中,我有一组3个按钮,即添加,删除和编辑
现在我的问题是当我单击添加按钮addpage.aspx应该显示在content2上...
但它显示在单独的页面中...
我不想在单独的页面中显示addpage.aspx.仅应在左侧显示3个按钮,在右侧(content2)显示addpage.aspx
我已经写了像这样的代码:response.redirect("AddPage.aspx")..
该怎么解决?
请帮助我
问候
karan
I am using asp.net,C#,VS 2005,sql server 2005..
i have a .aspx page already designed and coded...
now my problem is i am using master page ....
i have a master page having:
content1 and content2...
in content1 i have a set of 3 buttons i.e.,add,delete and edit
now my problem is when i click on add button addpage.aspx should be displayed on content2...
but it is displaying in separate page...
I dont want to display the addpage.aspx in separate page.. it should be displayed there only with left side having 3 buttons and right side(content2) having the addpage.aspx
i have written code like : response.redirect("AddPage.aspx")..
how to solve this?
please help me
regards
karan
推荐答案
在您的内容页面中放置多视图,然后根据需要将视图放置在该视图中.将多视图活动索引-1更改为0. multiview1.activeindex = 0;
当删除按钮multiview1.activeindex = 1 .................
put multiview in your contentpage and then place view in that one as per your requirement.and change multiview active index -1 to 0.when add button is click multiview1.activeindex=0;
when delete button multiview1.activeindex=1 .................
在AddPage.aspx中尝试添加@Page MasterPageFile ="〜\ your母版页名称........"
和
在页面指令标签之后添加您的内容占位符
例如:
< asp:Content ID ="Content1" ContentPlaceHolderID ="ContentPlaceHolder1" runat ="Server">
In AddPage.aspx try Adding @Page MasterPageFile= "~\your Master Page name........"
and
After Page dirctive Tag add your content place holder
For Example :
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
这篇关于在母版页中显示页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!