gpt4 book ai didi

c# - 当我尝试在我的网页中使用更新面板时,CSS 不工作?

转载 作者:太空宇宙 更新时间:2023-11-04 15:46:30 24 4
gpt4 key购买 nike

我有包含我的 css 的母版页的网页...当我在内容页面持有者中添加更新面板时,母版页上的 css 工作正常但相同的 css 在内容页面持有者中不起作用。

<%@ Page Title="District Master" Language="C#" MasterPageFile="~/webpages/MasterPage_new.master"
AutoEventWireup="true" CodeFile="frmDistrict.aspx.cs" Inherits="webpages_frmDistrict" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:ScriptManager ID="ScriptManager2" EnablePartialRendering="true" runat="server">
</asp:ScriptManager>
<div id="main_div">
<asp:UpdatePanel ID="uppnl" runat="server" Mode="Conditional">
<ContentTemplate>
<table style="width: 100%; float: left;">
<tr>
<td style="height: 100px; width: 100%; float: left;">
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnSearchOK" runat="server" Text="Ok" Font-Names="Verdana" Font-Size="11px"
Width="6%" Font-Bold="True" OnClick="btnSearchOK_OnClick" />
<asp:Button ID="btnRefresh" runat="server" Text="Refresh" Font-Names="Verdana" Font-Size="11px"
Width="11%" Font-Bold="True" OnClick="btnRefresh_OnClick" />
<asp:Button ID="btnClose" runat="server" Text="Close" Font-Names="Verdana" Font-Size="11px"
Width="9%" Font-Bold="True" OnClick="btnClose_OnClick" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>

最佳答案

那是因为 ASP.NET 更改了内容面板中所有元素的id,并在前面加上了主人的名字,如id="content" 将变为 id="body#content"。要验证检查浏览器中的查看源代码。

解决方案是根据生成的 ID 更新您的 CSS。

关于c# - 当我尝试在我的网页中使用更新面板时,CSS 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11698692/

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