asp.net中的母版页设计 [英] Master page designing in asp.net

查看:73
本文介绍了asp.net中的母版页设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

我已经将设计母版页的菜单条设置为水平模式,但在浏览器中显示垂直菜单时仍然可以,请您帮帮我,我的源代码如下

sir,

i have design master page placed menustrip set orientation in horizontal mode but still while view in browser it shows vertical menu can you please help me out my source code is as follows

<asp:ContentPlaceHolder id="head" runat="server">
    
</head>
<body>
    <form id="form1"  runat="server">
    <div align="center">
        style="font-family: 'Arial Narrow'; color: #FF0000; background-color: #FFFF00">My new web site<br />
        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" StaticSubMenuIndent="10px">
            <items>
                <asp:MenuItem NavigateUrl="~/Default.aspx" Text="HOME" Value="HOME">
                
                <asp:MenuItem NavigateUrl="~/About.aspx" Text="ABOUT" Value="ABOUT">
                
                <asp:MenuItem NavigateUrl="~/Contact.aspx" Text="CONTACT" Value="CONTACT">
                
                <asp:MenuItem NavigateUrl="~/Change.aspx" Text="CHANGE" Value="CHANGE">
                
            </items>
        
 <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        
    </div>
    </form>

推荐答案

使用此有价值的线程!

ASP.NET水平菜单控件 [
Use this valuable thread!

ASP.NET Horizontal Menu Control[^]

regards
Karthik.J


您已将内容占位符放在表单外部,然后在关闭表单之前将其关闭

尝试使用此代码

我复制了您的代码并尝试运行它,但是存在问题,因为它非常整洁

you have put your content place holder outside of your form and then close it before you have closed your form

try using this code

i copied your code and tried to run it but there were issues cos it was very neat

<form>

 <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
     <asp:Menu ID="Menu2" runat="server" Orientation="Horizontal">
         <Items>
         <asp:MenuItem NavigateUrl="~/Default.aspx" Text="HOME" Value="HOME"></asp:MenuItem>
             <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" Value="About">
             </asp:MenuItem>

 <asp:MenuItem NavigateUrl="~/Contact.aspx" Text="CONTACT" Value="CONTACT"></asp:MenuItem>
 <asp:MenuItem NavigateUrl="~/Change.aspx" Text="CHANGE" Value="CHANGE"></asp:MenuItem>          </Items>
     </asp:Menu>

 </asp:ContentPlaceHolder>
    </form>


为此尝试站点地图.

问候
伪造
try site map for thispurpose.

Regard
sham


这篇关于asp.net中的母版页设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆