酒店设置后的值相同 [英] property has the same value after setting it
问题描述
问:
我有一个面板的可见性= FALSE在的.aspx
文件,在某些时候在我的codeI设置知名度= true.but 的问题是:当我跟踪codeI找到Visible属性仍然等于假的,虽然我将其设置为true。
我的面板的名字是: pnl_DetailsGeneral
I have a panel the visibility = false in the .aspx
file ,at some point in my code i set the visibility = true.but the problem is: when i trace the code i find the visible property still equal false ,although i set it to true .
My panel name is :pnl_DetailsGeneral
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedValue == "2")
{
drp_Week.Enabled = false;
gv_Details.Visible = false;
panel_rmv.Visible = false;
pnl_DetailsGeneral.Visible = true;//Here when i put a break point and after setting visible to true i find `pnl_DetailsGeneral.Visible = false`
gv_DetailsGeneral.Visible = true;
BindGridGeneral();
}
else if (RadioButtonList1.SelectedValue == "1")
{
drp_Week.Enabled = true;
gv_Details.Visible = true;
gv_DetailsGeneral.Visible = false;
pnl_DetailsGeneral.Visible = false;
if (drp_Week.SelectedValue != "-1")
{
BindGrid();
}
}
}
这可能会使这个问题?
what may cause this problem?
推荐答案
Visible属性有一个特殊的属性:当你阅读的价值,它不仅报告了控制本身,还对其父。你得到的值是真正的知名度。
The Visible property has a special property: when you read the value it not only reports on the control itself but also on it's parent. The value you get is the "real" visibility.
因此很明显,你控制的母公司仍然是看不见的!
So apparently the parent of your control is still invisible!
当你设置父可见,你的控制将成为也是可见的。
When you set the parent to Visible, your control will become visible also.
这篇关于酒店设置后的值相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!