Visual Web Developer - 母版页上带有登录视图的子页面预览

发布于 2024-08-05 18:43:16 字数 742 浏览 2 评论 0原文

我遇到以下问题:

我运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多孤肩上扛 2024-08-12 18:43:16

不幸的是,这似乎是设计使然。如果必须使用设计视图,则必须暂时将 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文