Visual Web Developer - 母版页上带有登录视图的子页面预览
我遇到以下问题:
我运行 Visual Web Developer 2008。我有一个母版页和几个子页面。在母版页上,我有登录视图控件,如下所示:
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</LoggedInTemplate>
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" BackColor="White" Font-Size="Small">
</asp:Login>
</AnonymousTemplate>
</asp:LoginView>
当我处理子页面之一并切换到设计视图时,我只看到带有登录框的母版页(仅 AnonymousTemplate)。我无法将登录视图的模式更改为“LoggedInTemplate”,因为所有母版页元素在子页面设计模式下均被禁用。错误还是功能?如何预览我的子页面的设计?
I have the following problem:
I run Visual Web Developer 2008. I have one Master Page and few child pages. On the Master Page I have Login View control, as below:
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</LoggedInTemplate>
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" BackColor="White" Font-Size="Small">
</asp:Login>
</AnonymousTemplate>
</asp:LoginView>
When I work on one of child pages and I switch to Design view I see only Master Page with the Login Box (only AnonymousTemplate). I cannot change the mode of Login View to "LoggedInTemplate" because all Master Page elements are disabled in child page Design mode. Bug or feature? How can I preview Design for my child page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这似乎是设计使然。如果必须使用设计视图,则必须暂时将 ContentPlaceHolder 移到 LoginView 之外。
但老实说,我从来不信任“设计”视图 - 它显示的页面永远不会与给定浏览器(甚至 Internet Explorer)中显示的页面完全一样。我更喜欢使用“在浏览器中查看”来查看我的页面的外观。
Unfortunately, this appears to be by design. If you must use the Design view, you will have to temporarily move the ContentPlaceHolder outside of the LoginView.
In all honesty though, I have never trusted the Design view - it never shows the page exactly like it appears in a given browser (even Internet Explorer). I prefer using "View in Browser" to see what my page looks like.