问题描述
我正在显示一个Gridview,它具有显示更多详细信息的选项。
选择此选项后,将打开另一个GridView。
第一次运行页面时,有一个隐藏字段设置为false。
<asp:HiddenField ID="hfDetailsShown" runat="server" Value="false" />
当用户单击“显示更多详细信息”按钮时,我将hiddenfield设置为true
function ShowAll()
{
$(".ShowHide").each(function () {
if ($(this).html() == "Show") {
document.getElementById('<%= hfDetailsShown.ClientID %>').value = true;
$(this).html("Hide");
$(this).closest("tr").after("<tr><td colspan = '999' style='padding:0px'>" + $(this).next().html() + "</td></tr>");
}
});
}
现在在另一个类中,我想检查hfDetailsS??hown是否为true。 如何在另一个类中调用hfDetailsS??hown?
if (hfDetailsShown == true)
{
//do something
}
1楼
Chandrashekar Jupalli
0
2015-07-30 12:06:00
function ShowAll()
{
$(".ShowHide").each(function () {
if ($(this).html() == "Show") {
document.getElementById('<%= hfDetailsShown.ClientID %>').value = "true";
$(this).html("Hide");
$(this).closest("tr").after("<tr><td colspan = '999' style='padding:0px'>" + $(this).next().html() + "</td></tr>");
}
});
}
if (document.getElementById('<%= hfDetailsShown.ClientID %>').value== "true")
{
//do something
}
2楼
GH_
0
2015-07-30 12:14:17
从您的问题中我了解到的是,您想检查hfDetailsS??hown的值。
var yourRequestedField = document.getElementById('<%= hfDetailsS??hown.ClientID%>')。value;