gpt4 book ai didi

c# - MasterPage 对象页面对象后面的aspx 页面对象?

转载 作者:行者123 更新时间:2023-11-28 06:51:16 25 4
gpt4 key购买 nike

我的 MasterPage 文件中有一个下拉菜单,它下拉 behind aspx 页面上的对象。我使用 CSS 将 100 的 z-index 应用于 masterPage 菜单,将 -1 的 z-index 应用于 aspx 页面中的标记。我添加了 position: relative;在每个的 CSS 中。这是行不通的。我突然想到,这甚至可能做不到?但肯定其他人在他们的 masterPage 文件中有一个下拉菜单并且它工作正常(不会被下面页面中的元素隐藏)。有谁知道我想做的事情是否可行。如果是这样,有人对我可能做错了什么有任何想法吗?

母版页代码:

</head>

<body class="innermainbg">
<form id="Form1" runat="server">

<div>
<div class="header">
<div id="nav" class="clear hideSkiplink nav" >
<asp:Menu ID="NavigationMenu" runat="server" Orientation="Horizontal" CssClass="menu" >
<staticmenuitemstyle horizontalpadding="20"/>

<Items>
<asp:MenuItem Text="Search" NavigateUrl="~/Default.aspx" Value="Item1" >
<asp:MenuItem Text="Search By Age" NavigateUrl="~/SearchByAge.aspx" Value="Sub Item2"></asp:MenuItem>
<asp:MenuItem Text="Search By Price" NavigateUrl="~/SearchByPrice.aspx" Value="Sub Item3"></asp:MenuItem>
<asp:MenuItem Text="Search By Date" NavigateUrl="~/SearchByDate.aspx" Value="Sub Item2"></asp:MenuItem>
<asp:MenuItem Text="Search By Type" NavigateUrl="~/SearchByType.aspx" Value="Sub Item3"></asp:MenuItem>
<asp:MenuItem Text="Advanced Search" NavigateUrl="~/AdvSearch.aspx" Value="Sub Item1"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Get Listed Free!" NavigateUrl="~/GetListed.aspx" Value="Item2">
</asp:MenuItem>

<asp:MenuItem Text="Advertise" NavigateUrl="~/Advertise.aspx" Value="Item2">
<asp:MenuItem Text="Links" NavigateUrl="~/Links.aspx" Value="Sub Item1"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="About" NavigateUrl="~/About.aspx" Value="Item2">
<asp:MenuItem Text="Terms" NavigateUrl="~/Terms.aspx" Value="Sub Item1"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Contact" NavigateUrl="~/Contact.aspx" Value="Item2">
<asp:MenuItem Text="Help" NavigateUrl="~/Help.aspx" Value="Sub Item1"></asp:MenuItem>
<asp:MenuItem Text="FAQs" NavigateUrl="~/FAQs.aspx" Value="Sub Item2"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
</div>
</div>

<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear"></div>
</div>
<div></div>
<div class="footerholder">
<div id="footerContent" class="footer">
© 2014 Professional Expressions Inc. ClassesnWorkshops.com is a registered Trademark of Professional Expressions Inc. All rights reserved.
</div>
</div>
</form>

</body>

</html>

部分CSS代码: 。后退 { position:relative; z-指数:-1;

div.menu
{
padding: 0px 0px 0px 0px;
float: right;
width: 100%;
position: relative;
z-index: 100;
}

ClassResults.aspx页面代码:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
CodeBehind="ClassResults.aspx.cs" Inherits="ClassesnWorkshops.ClassResults" %>

邮政编码: 距离: lblSearchWords

<div align="left" style="background-color: transparent; height: 250px; float:left; width:100%; background-repeat:no-repeat; background-position: 50% 50%;">
<div style="width:13%; float:left; display:inline;" class="rtPad10px">
<asp:Image ID="spacer1" runat="server" ImageUrl="~/Images/spacer_130x18px.png" />
</div>
<div style="width:69%; height:100%; float:left; display:inline;">
<br />
<asp:Label ID="lblTotalItemCount" runat="server" Enabled="False"></asp:Label>
&nbsp; &nbsp; &nbsp;
<asp:Label ID="lblCurrentPage" runat="server" Enabled="False"></asp:Label>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;

<asp:Label ID="lblSort" runat="server" Enabled="False" >Sort:</asp:Label> &nbsp;
<asp:DropDownList ID="ddlSort" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlSort_SelectedIndexChanged" ViewStateMode="Enabled" EnableViewState="true" >
<asp:ListItem Value="Title">Class Title</asp:ListItem>
<asp:ListItem Value="schoolName">School Name</asp:ListItem>
<asp:ListItem Value="ClassSubject">Subject</asp:ListItem>
<asp:ListItem Value="Miles">Distance</asp:ListItem>
<asp:ListItem Value="lowestCost">Cost (low to high)</asp:ListItem>
<asp:ListItem Value="dateStart">Start Date</asp:ListItem>
</asp:DropDownList>

<asp:Button ID="btnSort" runat="server" Text="Sort" onclick="btnSort_Click" />
&nbsp; &nbsp; &nbsp;
<asp:Label ID="lblItemsPerPage" runat="server" Enabled="False">Items per page:</asp:Label>&nbsp;
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
ViewStateMode="Enabled" EnableViewState="true" onselectedindexchanged="ddlPageSize_SelectedIndexChanged">
<asp:ListItem Text="1" Selected="True" Value="1"></asp:ListItem>
<asp:ListItem Text="10" Value="10"></asp:ListItem>
<asp:ListItem Text="20" Value="20"></asp:ListItem>
<asp:ListItem Text="50" Value="50"></asp:ListItem>
<asp:ListItem Text="100" Value="100"></asp:ListItem>
<asp:ListItem Text="200" Value="200"></asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Label ID="lblValidationZip" runat="server" Enabled="False" ForeColor="Red" Text="A valid 5 digit zipCode is required."></asp:Label><br />
<asp:Label ID="lblMessage" runat="server" Text="lblMessage"></asp:Label>
<br />
<asp:Label ID="lblMsgTooManyOrTooFew" runat="server" Text=""></asp:Label>
<br />
<asp:Repeater ID="rptClasses" runat="server" >
<ItemTemplate>
<asp:Table runat="server" ID="tblClassesReturned" style="width:99%" >
<asp:TableRow ID="TableRow1" runat="server">
<asp:TableCell style="width:15%; text-align:left;">
<img src='C:\Users\Teresa\My Webs\ClassesnWorkshops\ClassesnWorkshops\images\logos\<%# DataBinder.Eval(Container.DataItem, "logoID") %>.jpg' align="left" alt="School Logo">
</asp:TableCell>
<asp:TableCell ID="TableCell1" runat="server" style="width:41%; float:left; text-align:left;">
Subject: <%# String.Format("{0:0.0}", DataBinder.Eval(Container.DataItem, "ClassSubject")) %><br />
<b>Title: <asp:HyperLink ID="hlClass" NavigateUrl='<%#"~/Class.aspx?classID=" + DataBinder.Eval(Container.DataItem, "ClassID")%>' Text=<%# String.Format("{0:0.0}", DataBinder.Eval(Container.DataItem, "ClassTitle")) %> Target="_blank" runat="server" /> </b><br></br>
<asp:Label ID="lblCostRange" ToolTip="Lowest price usually indicates residence, member or early bird cost. Highest price usually indicates non-residence, non-member or non-earlybird cost." runat="server">
Cost Range: <%# String.Format("{0:c}", DataBinder.Eval(Container.DataItem, "lowestCost")) %> - <%# String.Format("{0:c}", DataBinder.Eval(Container.DataItem, "highestCost")) %><br />
</asp:Label>
<asp:Label ID="lblCostNote" runat="server" font-size="8pt">
&nbsp; * Additional Fees or Discounts May Apply.
</asp:Label>
<br />
<asp:Label ID="lblClassSeason" ToolTip="Season that this class is held." runat="server">
<%# String.Format("{0:0.0}", DataBinder.Eval(Container.DataItem, "ClassSeason")) %> &nbsp; &nbsp;
</asp:Label>
<asp:Label ID="lblClassYear" ToolTip="Year that this class is held" runat="server">
<%# String.Format("{0:0}", DataBinder.Eval(Container.DataItem, "ClassYear")) %> &nbsp; &nbsp;
</asp:Label>
<asp:Label ID="ClassDays" ToolTip="Days of the Week this class is held: M=Monday, T=Tuesday, W=Wednesday, H=Thursday, F=Friday, A=Saturday, S=Sunday" runat="server">
<%# String.Format("{0:0.0}", DataBinder.Eval(Container.DataItem, "ClassDays")) %> &nbsp; &nbsp;
</asp:Label>
<%# String.Format("{0:0.0}", DataBinder.Eval(Container.DataItem, "ClassStartTime")) %><br />
</asp:TableCell><asp:TableCell ID="TableCell2" runat="server" style="width:44%; float:left; text-align:left;">
<b><asp:HyperLink ID="HyperLink1" NavigateUrl="~/School.aspx" Text=<%# DataBinder.Eval(Container.DataItem, "schoolName") %> Target="_blank" runat="server" /> </b>
-
<%# String.Format("{0:0.0}", DataBinder.Eval(Container.DataItem, "Miles")) %> miles away
<br />
Campus: <%# DataBinder.Eval(Container.DataItem, "campus") %><br />
<%# DataBinder.Eval(Container.DataItem, "street") %> &nbsp;
<%# DataBinder.Eval(Container.DataItem, "city") %>, &nbsp;
<%# DataBinder.Eval(Container.DataItem, "state") %> &nbsp;
<%# DataBinder.Eval(Container.DataItem, "zip") %><br />
<asp:HyperLink ID="hlSchool" NavigateUrl=<%# DataBinder.Eval(Container.DataItem, "web") %> Text=<%# DataBinder.Eval(Container.DataItem, "web") %> Target="_blank" runat="server" /> <br>
<%-- %><br><%# DataBinder.Eval(Container.DataItem, "longDesc") --%>

</asp:TableCell></asp:TableRow></asp:Table><br /><hr>
<br />
</ItemTemplate>
</asp:Repeater>


<br />
<asp:LinkButton ID="LnkFirst" runat="server" onclick="LnkFirst_Click">First</asp:LinkButton>&nbsp; &nbsp; <asp:LinkButton ID="LnkPrevious" runat="server" onclick="LnkPrevious_Click">Previous</asp:LinkButton>&nbsp; &nbsp; <asp:Repeater ID="rptPages" runat="server">
<ItemTemplate>
<asp:LinkButton ID="btnPage" CommandName="Page" CommandArgument="<%# Container.DataItem %>" runat="server">
<%# Container.DataItem %>
</asp:LinkButton>&nbsp; &nbsp;</ItemTemplate></asp:Repeater>&nbsp; &nbsp; <asp:LinkButton ID="LnkNext" runat="server" onclick="LnkNext_Click">Next</asp:LinkButton>&nbsp; &nbsp; <asp:LinkButton ID="LnkLast" runat="server" onclick="LnkLast_Click">Last</asp:LinkButton><br />
<br />
<%--
<asp:Label ID="lblValidationZip" runat="server" Enabled="False" ForeColor="Red" Text="A valid 5 digit zipCode is required."></asp:Label><br />
<asp:Label ID="lblMessage" runat="server" Text="lblMessage"></asp:Label>
<br />
<asp:Label ID="lblMsgTooManyOrTooFew" runat="server" Text=""></asp:Label>
--%>
</div><div style="width:17%; float:left; display:inline;" ><asp:Image
ID="spacer2" runat="server" ImageUrl="~/Images/spacer_170x18px.png" /></div></div></asp:Content>

最佳答案

使用浏览器的检查元素工具检查您的 css 和 html 结构。在浏览器中打开站点,右键单击它,在菜单底部您将检查元素选项。这会给你完整的 html 和你的 css View 。您可以编辑 css,它会在您的页面上即时更改。

关于c# - MasterPage 对象页面对象后面的aspx 页面对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33749198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com