如何在asp.net的母版页眉上制作菜单 [英] how to make menus on the header of master page in asp.net

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

问题描述

如何在asp.net的母版页眉上制作菜单

how to make menus on the header of master page in asp.net

推荐答案

您应该首先尝试过.

母版页是模板.与在其中设计UI控件的普通页面没有什么不同.就像您将菜单控件放置在普通页面上一样,将其放置在母版页面上.
由于母版页没有固定的模板布局,因此它为您提供了以所需方式设计母版页的灵活性.因此,如果您需要在页眉"中放置内容,请首先定义具有页眉的母版页布局.完成此操作后,将菜单控件放入其中.

样本:
You should have tried first.

Masterpage is a template. Nothing different in it from a normal page for designing UI controls in it. Just like you place a menu control on normal page, place it on Master page.
Since there is no fixed template layout for master page, it provides you the flexibility to design your Masterpage the way you want. So, if you need to place something in ''header'', first define a layout of your master page that has a header. Once this is done, place your menu control in it.

Sample:
<table>
 <tr style="height: 100px">
  <td colspan="2">
    <!-- Header : Place Menu here -->
  </td>
 </tr>
 <tr>
  <td>Body Column 1: Content place holder can be placed here</td>
  <td>Body Column 2: Content place holder can be placed here</td>
 </tr>
 <tr style="height: 20px">
  <td colspan="2">
   <!-- footer -->
  </td>
 </tr>
</table>


试试吧!


Try out!


您可以在母版页中尝试一下

You can try this in the master page

  <div id="topNav">
       <div class="tab" id="divMenuTabHome" runat="server">
        <a href="Home.aspx" id="aMenuTabHome" runat="server">Home</a></div>
<div class="tab" id="divMenuTabDownload" runat="server">
     <a href="Download.aspx" id="aMenuTabDownload" class="freeMenu" runat="server">Download</a>
     <img id="ribbonDownload" src="images/Red-Ribbon copy.png" class="ribbon"/></div>
     <div class="tab" id="divMenuTabProfile" runat="server">
     <a href="UserProfile.aspx" id="aMenuTabProfile" runat="server">Profile</a></div>
     <div class="tab" id="divMenuTabProject" runat="server">
     <a href="ChooseCategory.aspx" id="aMenuTabProject" class="freeMenu" runat="server">Post a Project</a>
      <img id="ribbonProj" src="images/Red-Ribbon copy.png" class="ribbon" style="margin-left: 125px;"/></div>
      <div class="tab" id="divMenuTabTestimonial" runat="server">
    <a href="TestomonialSubmit.aspx" id="aMenuTabTestimonial" runat="server">Testimonials</a></div>
   <div class="tab" id="divMenuTabAdvertisement" runat="server" style="border-right: medium none;">
   <a href="Advertisement.aspx" id="aMenuTabAdvertisement" runat="server">Advertisement</a></div>
   <div style="float: right;">
   <asp:TextBox ID="txtSearch" runat="server" CssClass="searchTextBox searchMaskTab" Text="" Font-Bold="true" />
       </div>
      </div>


这篇关于如何在asp.net的母版页眉上制作菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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