- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我下载了一个名为“Gentelella-Master Admin”的模板,用于我的 asp.net 应用程序。情况就像我有一个启用了自动回发的下拉列表,当它不活动时,隐藏的 div 会折叠到下拉列表中。你能告诉我我的编码有什么问题吗?感谢您的提前。
注意:当购买产品面板未折叠(隐藏)时,每当我更改已执行自动回发的下拉列表“产品”时,购买产品面板都会显示。
这里是 INDEX.ASPX
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>New Trade Header<asp:HiddenField ID="hf1" runat="server" /></h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class=""><i class=""></i></a>
</li>
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li><a class=""><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div id="demo-form2" class="form-horizontal form-label-left data-parsley-validate">
<div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="Label4" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Product</asp:Label>
<asp:DropDownList ID="ddProd" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required" DataTextField="prodType" DataValueField="prID" AutoPostBack="true">
</asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblSpecs" runat="server" class="col-md-12 col-sm-3 col-xs-12 tem">Product Specification</asp:Label>
<asp:DropDownList ID="ddProdSpec" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required" DataTextField ="specDesc" DataValueField ="specID">
</asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="Label3" runat="server" class="col-md-12 col-sm-3 col-xs-12 tem" >Reference. No</asp:Label>
<asp:TextBox ID="txtRefNo" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12" ></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblContractNo" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Contact No *</asp:Label>
<asp:TextBox ID="txtContractNo" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12" required="required"></asp:TextBox>
</div>
</div>
<div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblDeliveryDate" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Delivery Date *</asp:Label>
<asp:TextBox ID="txtDeliveryDate" runat="server" class="date-picker form-control col-md-7 col-xs-12 required"></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPurchaseContractTerms" runat="server" class="col-md-12 col-sm-3 col-xs-12 tem">Purchase Contract Terms</asp:Label>
<asp:DropDownList ID="ddPurContractTerms" runat="server" DataTextField="purconName" DataValueField="purconID" CssClass="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="Label6" runat="server" class="col-md-8 col-sm-3 col-xs-12 tem">Exhange Rate</asp:Label>
<asp:DropDownList ID="ddExRate" runat="server" DataTextField="exRateValue" DataValueField="exRateID" class="form-control col-md-3 col-sm-3 col-xs-12 required">
</asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="Label7" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Vessel</asp:Label>
<asp:DropDownList ID="ddVessel" runat="server" DataTextField="VesselName" DataValueField="vID" class="form-control col-md-3 col-sm-3 col-xs-12 required">
</asp:DropDownList>
</div>
</div>
<div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblQuantity" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Quantity</asp:Label>
<asp:TextBox ID="txtQuantity" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblValue" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Unit</asp:Label>
<asp:DropDownList ID="ddValue" runat="server" DataTextField="metricDesc" DataValueField="metricID" class="form-control col-md-3 col-sm-3 col-xs-12 required">
</asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="Label10" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Load Port</asp:Label>
<asp:DropDownList ID="ddLoadPort" runat="server" DataTextField="loadPortName" DataValueField="loadportID" class="form-control col-md-3 col-sm-3 col-xs-12 required">
</asp:DropDownList>
<!--remove autopostback AutoPostBack="True"-->
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="Label11" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Disport</asp:Label>
<asp:DropDownList ID="ddDisport" runat="server" DataTextField="disportName" DataValueField="disportID" class="form-control col-md-3 col-sm-3 col-xs-12 required">
</asp:DropDownList>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-sm-3 col-xs-12">
<asp:Label ID="Label8" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Buyer</asp:Label>
<asp:DropDownList ID="ddBuyer" runat="server" DataTextField="companyName" DataValueField="comID" class="form-control col-md-6 col-sm-3 col-xs-12 required">
</asp:DropDownList>
</div>
<div class="col-md-6 col-sm-3 col-xs-12">
<asp:Label ID="Label9" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Seller</asp:Label>
<asp:DropDownList ID="ddSeller" runat="server" DataTextField="companyName" DataValueField="comID" class="form-control col-md-6 col-sm-3 col-xs-12 required">
</asp:DropDownList>
</div>
</div>
<div class="form-group" style="text-align: right">
<div class="col-md-12 col-sm-12 col-xs-12 ">
<!-- modals -->
<!-- Large modal -->
<button id="btnModalCreate" runat="server" type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Create</button>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" style="text-align:left">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">Confirmation</h4>
</div>
<div class="modal-body">
<h4>Creating Trade Header</h4>
<p>Do you want to save New Trade Header Details?</p>
<p>If you are not sure about the details, click Cancel</p>
</div>
<div class="modal-footer">
<!-- <asp:Button ID="bttnNCancel" runat="server" class="btn btn-success" Text="Cancel" />-->
<button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
<asp:Button ID="bttnCreate" runat="server" class="btn btn-primary" Text="Save"/>
</div>
</div>
</div>
</div>
<button id="bttnModEdit" runat="server" type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example1-modal-lg" visible ="false">Edit</button>
<div class="modal fade bs-example1-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" style="text-align:left">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="H1">Confirmation</h4>
</div>
<div class="modal-body">
<h4>Editing Trade Header</h4>
<p>Do you want to save changes on New Trade Header Details?</p>
<p>If you are not sure about the details, click Cancel</p>
</div>
<div class="modal-footer">
<!--<asp:Button ID="bttnNCancel1" runat="server" class="btn btn-success" Text="Cancel" />-->
<button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
<asp:Button ID="bttnEdit" runat="server" class="btn btn-primary" Text="Save Changes" Visible="false" />
</div>
</div>
</div>
</div>
<!-- <asp:Button ID="bttnNTSave" runat="server" class="btn btn-primary" Text="Save" Visible="false" />-->
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end of New Trade Panel-->
<!--buy product panel-->
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Buy Product</h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class=""><i class=""></i></a>
</li>
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li><a class=""><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<asp:HiddenField ID="hfrfIDH" runat="server" />
<div class="x_content">
<div id="Div1" class="form-horizontal form-label-left data-parsley-validate">
<div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPurSeller" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Seller</asp:Label>
<asp:DropDownList ID="ddPurSellers" runat="server" DataTextField="companyName" DataValueField="comID" CssClass="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPurBuyer" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Buyer</asp:Label>
<asp:DropDownList ID="ddPurBuyer" runat="server" DataTextField="companyName" DataValueField="comID" CssClass="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPurProduct" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Product</asp:Label>
<asp:DropDownList ID="ddPurProd" runat="server" DataTextField="prDesc" DataValueField="pID" CssClass="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:DropDownList>
<asp:HiddenField ID="hfProdCode" runat="server" />
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPurPrem" runat="server" class="col-md-10 col-sm-3 col-xs-12 tem ">Purchase Premium (+/-)</asp:Label>
<asp:TextBox ID="txtPurPrem" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:TextBox>
</div>
</div>
<div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblDate1" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Date From</asp:Label>
<asp:TextBox ID="txtDateFrom" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblDate2" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Date To</asp:Label>
<asp:TextBox ID="txtDateTo" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPurQty" runat="server" class="col-md-8 col-sm-3 col-xs-12 tem">Purchase Quantity</asp:Label>
<asp:TextBox ID="txtPurQty" runat="server" class="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblMetric" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Unit</asp:Label>
<asp:DropDownList ID="ddMetric" runat="server" DataTextField="metricDesc" DataValueField="metricID" CssClass="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:DropDownList>
</div>
</div>
<div class="form-group" style="text-align: right">
<div class="col-md-12 col-sm-12 col-xs-12 ">
<button id="bttnModBuyProd" runat="server" type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example2-modal-lg" >Add</button>
<div class="modal fade bs-example2-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" style="text-align:left">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="H2">Confirmation</h4>
</div>
<div class="modal-body">
<h4>Buy Product</h4>
<p>Do you want to add this Trade?</p>
<p>If you are not sure about the details, click Cancel</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
<asp:Button ID="bttnBAdd" runat="server" class="btn btn-primary" Text="Add" />
</div>
</div>
</div>
</div>
<!--<asp:Button ID="bttnBcancel" runat="server" class="btn btn-success" Text="Cancel" />-->
</div>
</div>
</div>
<!--GRIDVIEW-->
<asp:GridView ID="grvBuyProduct" runat="server" AutoGenerateColumns="False" ShowHeaderWhenEmpty="True" class="table-responsive table table-striped jambo_table bulk_action" CellPadding="4" ForeColor="#333333" GridLines="None">
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:CommandField ShowDeleteButton="True" DeleteText="Remove" />
<asp:BoundField HeaderText="Seller" DataField="pSeller"/>
<asp:BoundField HeaderText="Buyer " DataField="pBuyer"/>
<asp:BoundField HeaderText="QTY" DataField="pQTY" DataFormatString="{0:#,###0.000}"/>
<asp:BoundField HeaderText="Code" DataField="pCode" />
<asp:BoundField HeaderText="Product" DataField="pProduct" />
<asp:BoundField HeaderText="Date From" DataField="Date1" DataFormatString ="{0:dd/M/yyyy}" />
<asp:BoundField HeaderText="Date To" DataField="Date2" DataFormatString ="{0:dd/M/yyyy}" />
<asp:BoundField HeaderText="Total Days" DataField="TotalDays" />
<asp:BoundField HeaderText="Pur Prem" DataField="pPurPremium" />
<asp:BoundField HeaderText="Ave" DataField="Ave" DataFormatString="{0:#,###0.000}"/>
<asp:BoundField HeaderText="Net Price" DataField="NetPurPrice" DataFormatString="{0:#,###0.000}"/>
<asp:BoundField HeaderText="USD" DataField="USD" DataFormatString="{0:#,###0.000}"/>
<asp:BoundField HeaderText="AED" DataField="AED" DataFormatString="{0:#,###0.000}"/>
</Columns>
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
</asp:GridView>
<!--table-->
<div class="x_title">
<h2>Operational Cost</h2>
<div class="clearfix"></div>
</div>
<div class="form-group">
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblCost" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Cost</asp:Label>
<asp:DropDownList ID="ddOperationalCosts" DataTextField="costName" DataValueField="costID" runat="server" CssClass="form-control col-md-3 col-sm-3 col-xs-12 required"></asp:DropDownList>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<asp:Label ID="lblPrice" runat="server" class="col-md-7 col-sm-3 col-xs-12 tem">Price</asp:Label>
<asp:TextBox ID="txtPrice" runat="server" class="form-control col-md-3 required"></asp:TextBox>
</div>
<div class="col-md-3 col-sm-3 col-xs-12">
<br />
<asp:Button ID="bttnOPAdd" runat="server" class="btn btn-primary" Text="Add" />
</div>
</div>
<!--class="table table-striped jambo_table bulk_action"-->
<asp:GridView ID="grvOperationalCost" runat="server" AutoGenerateColumns="False" ShowHeaderWhenEmpty="True" CellPadding="4" class="table table-striped jambo_table bulk_action" ForeColor="#333333" GridLines="None">
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:CommandField ShowDeleteButton="True" DeleteText="Remove" />
<asp:BoundField HeaderText="ID" DataField="plCostID"/>
<asp:BoundField HeaderText="Cost" DataField ="plCostName" />
<asp:BoundField HeaderText="USD" DataField="plCostPrice"/>
<asp:BoundField HeaderText="AED" DataField ="plCostPriceAED" />
</Columns>
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
</asp:GridView>
<div class="form-group" style="text-align: right">
<div class="col-md-12 col-sm-12 col-xs-12 ">
<button id="bttnModFinalSave" runat="server" type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example3-modal-lg" visible="false">Save</button>
<div class="modal fade bs-example3-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" style="text-align:left">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="H3">Confirmation</h4>
</div>
<div class="modal-body">
<h4>Saving New Trade Details</h4>
<p>Do you want to add this Trade?</p>
<p>If you are not sure about the details, click Cancel</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
<asp:Button ID="bttnFinalSave" runat="server" class="btn btn-primary" Text="Save" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end of Buy Product Panel-->
最佳答案
您可能必须在回发后再次设置 div 的可见性。
if (IsPostBack)
{
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "showDiv", "document.getElementById('myDiv').style.display = 'block';", true);
}
关于javascript - AutoPostBack 导致隐藏的 div 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39243473/
AutoPostBack=True 和 AutoPostBack=False 有什么区别? 最佳答案 取自 http://www.dotnetspider.com/resources/189-Auto
开始之前,我已经看过this question about a very similar topic (以及 this one 和 this one ),没有一个能完全回答我的问题。我已经理解这些问题
我有一个页面,当发生自动或部分回发时,焦点设置到地址栏而不是下一个控件。有趣的是,当我在我的 RadScriptBlock 中放置一个警报时,在单击“确定”之后,焦点会转到正确的控件 - 或者 - 如
我有 3 select输入 form , 代表日期。一个是日,一个是月,一个是年。 这些选择的选项是通过使用 javascript 添加的:例如,如果选择的年份可以被 4 整除并且月份是二月,那么一天
我想在 asp:DropDownList 中选择特定值时显示确认对话框。如果确认对话框返回 false(取消),那么我想阻止 AutoPostBack。 但是,它会忽略 foo() 的返回值并实际执
我有一个 asp.net 页面,上面有许多控件,包括: 带有 autopostback = true 和服务器端 textchanged 事件实现的文本框 实现了服务器端点击事件的按钮 一旦用户离开控
在一个简单的 ASP 页面中,TextBox AutoPostBack 事件将阻止按钮单击事件(除非按钮被快速点击)和其他控件(如 ListBox)的 AutoPostBack 事件。 这里有一个类似
我们在带有 AutoPostBack="true" 的 UpdatePanel 中有两个复选框 单击这些复选框时,将触发 CheckedChanged 事件。一切顺利。 现在,我们有另一个作用于相
我正在构建一个页面,其中包含页面上的一些静态组件(下拉列表、按钮、用于容纳它们的表格),但是一个表格单元格充满了可变生成的复选框。按下按钮时,页面代码会计算要放置的复选框并为每个需要的复选框创建一个新
我有一个带有两个下拉列表的 WebForm,其中第二个的内容取决于第一个。 因此,如果用户更改类别,则第二个下拉列表需要填写子类别列表。 这听起来像是 AutoPostBack 的典型工作。 但是,A
搜索后,我发现了许多建议,但没有一个能解决问题。 在属性窗口中,TextBox (Suggested here) 的 EnableViewState = True。我在 TextBox 中输入一个新
一个 TextBox设置为 AutoPostback因为更改值会导致重新计算和显示许多(仅显示)字段。 这很好用。 但是,当该字段被移出时,焦点会短暂移动到下一个字段,然后在重新绘制页面时消失,因此任
在 jQuery 中,有什么方法可以区分回发下拉列表和非回发下拉列表(ASP.NET 3.5): $('select').change(function(e) { //somethin
我有这段代码可以与用户检查是否可以离开页面而不保存: window.onbeforeunload = !isPostBack && confirmExit; function isPostBack(
我想做this但在 ASP.NET 中。我该如何在 asp.net/背后的代码中编写这个?我已经有了 protected void chkBox_CheckedChanged(object sende
我下载了一个名为“Gentelella-Master Admin”的模板,用于我的 asp.net 应用程序。情况就像我有一个启用了自动回发的下拉列表,当它不活动时,隐藏的 div 会折叠到下拉列表中
是否可以在没有 AutoPostBack=True 的情况下强制下拉列表触发 OnSelectedIndexChanged 事件? 我之所以这么说,是因为我的表单中有一些 RadComboBoxes(
花了一天时间寻找解决方案。但没有成功。我只是想为我的学生创建一个百分比计算表。这是我的 .aspx 代码 $(document).ready(function
因为我什至无法描述问题,所以我不知道如何放置标题,这就是问题所在.. (这只是简单的问题) 假设我有两个复选框设置为 AutoPostBack=True protected void cbPop_Ch
有人可以建议...我无法弄清楚为什么在我更改 ddl 的索引后自动回发不会发生。 请告知我缺少什么?这是标记: 最佳答案 AutoPostBack 对我有用,但您可能想尝试设置 CausesVali
我是一名优秀的程序员,十分优秀!