JQuery更改了样式,但是服务端无法更新. [英] JQuery to change the style , but service side can not be updated.
本文介绍了JQuery更改了样式,但是服务端无法更新.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的JQuery将更新UI中显示或隐藏的两个单元格:
Hi,
Below JQuery is going to update two cells in UI show or hide:
<pre lang="xml">function DisplayExistingStatus() {
if($("#<%=IsNew.ClientID %>").val() == $("#<%=hfIsNew.ClientID %>").val()) {
$("#<%=tdLblECS.ClientID %>")[0].style.display = "";
$("#<%=tdECS.ClientID %>")[0].style.display = "";
ValidatorEnable($("#<%= rfvExistingCollStatus.ClientID %>")[0], true);
//ValidatorEnable(document.getElementById("<%= rfvExistingCollStatus.ClientID %>"), true);
} else {
$("#<%=tdLblECS.ClientID %>")[0].style.display = "none";
$("#<%=tdECS.ClientID %>")[0].style.display = "none";
ValidatorEnable($("#<%= rfvExistingCollStatus.ClientID %>")[0], false);
//ValidatorEnable(document.getElementById("<%= rfvExistingCollStatus.ClientID %>"), false);
}
}
在页面加载事件中,显示/隐藏从DB检索的记录:
And in page load events, do display/hide with the record which retrieve from DB:
if (this.IsNew.SelectedValue != ViewState["IsNew"].ToString())
{
this.tdECS.Attributes.Add("style", "display:none");
this.tdLblECS.Attributes.Add("style", "display:none");
this.rfvExistingCollStatus.Enabled = false;
}
为了在隐藏时将一个子列更新为null,我编写了一个检查函数:
In order to update one sub column to null when it was hide, I have written one check function:
if ((this.Master.FindControl("Content").FindControl("tdECS") as HtmlTableCell).Style.Value == "display:none")
collObj.ExistingCollStatus = null;
但是,更改UI后,无法更新此样式.
等待帮助
However, this style can not be updated when UI have been changed.
Wait for help
推荐答案
(#<%= IsNew.ClientID%>").val()==
("#<%=IsNew.ClientID %>").val() ==
(#<%= hfIsNew.ClientID%>").val()){
("#<%=hfIsNew.ClientID %>").val()) {
(#<%= tdLblECS.ClientID%>")[ 0] .style.display =";
("#<%=tdLblECS.ClientID %>")[0].style.display = "";
这篇关于JQuery更改了样式,但是服务端无法更新.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文