日期:2014-05-18  浏览次数:20465 次

很棘手的问题,请大家帮忙解决下!
aspnet页面,两个事件同时回发,页面变白,怎么办?
我的textBox写了_TextChanged事件,选了回发
页面还有个dorpDownList也有回发事件,
当我在TextBox内添完后马上点DroptDownList,
页面马上变成白色了,,怎么办?

------解决方案--------------------
给个我写的脚本你
function BuildLoadPanel()
{
var showStr = " <iframe id= 'iframeLoadWait ' frameborder= '0 ' style= 'display:none; Z-INDEX: 99; POSITION: absolute;FILTER:alpha(opacity=50); '> </iframe> ";
showStr += " <div id= 'divLoadWait ' style= 'display:none;POSITION:absolute;z-index:100;FILTER:alpha(opacity=50); '> </div> "
showStr += " <div id= 'divLoadText ' style= 'height:50px;width:160px;display:none;POSITION:absolute;z-index:101; '> <table border= '0 ' cellpadding= '0 ' cellspacing= '0 ' width= '100% ' height= '100% '> <tr> <td align= 'center ' valign= 'middle ' style= 'background-color:#9EB5DF; '> <table border= '0 ' cellpadding= '5 ' cellspacing= '0 '> <tr> <td style= 'background-color:#D2E3FD;font-family:Arial, 宋体;font-size: 15px; '> 正在处理,请稍候... </td> </tr> </table> </td> </tr> </table> </div> "
document.write(showStr);
}
function LoadDataWaitPanel()
{
this.ShowPanel = function (coverElement)
{

var iframe = document.getElementById( "iframeLoadWait ");
var div = document.getElementById( "divLoadWait ");
var divText = document.getElementById( "divLoadText ");

if(div == null || iframe == null)return;

iframe.style.width = coverElement.offsetWidth;
iframe.style.height = coverElement.offsetHeight;
iframe.style.posTop = coverElement.offsetTop;
iframe.style.posLeft = coverElement.offsetLeft;
div.style.width = coverElement.offsetWidth;
div.style.height = coverElement.offsetHeight;
div.style.posTop = coverElement.offsetTop;
div.style.posLeft = coverElement.offsetLeft;
divText.style.posTop=coverElement.offsetTop+coverElement.offsetHeight/2-divText.style.posHeight/2;
divText.style.posLeft=coverElement.offsetLeft+coverElement.offsetWidth/2-divText.style.posWidth/2;
//alert(coverElement.offsetWidth);
//alert(coverElement.offsetHeight);
iframe.style.display = "block ";
div.style.display = "block ";
divText.style.display= "block "
}
this.HidePanel = function()
{
var iframe = document.getElementById( "iframeLoadWait ");
var div = document.getElementById( "divLoadWait ");
var divText = document.getElementById( "divLoadText ");
if(div == null || iframe == null)return;
iframe.style.display = "none ";
div.style.display = "none ";
divText.style.display= "none "
}
}
BuildLoadPanel();
function LoadPanel(obj)
{
var panel = new LoadDataWaitPanel();
panel.ShowPanel(obj);
}
function HidePanel()
{
var panel = new LoadDataWaitPanel();
panel.HidePanel();
}
------解决方案--------------------
aspnet页面,两个事件同时回发,页面变白,怎么办?
我的textBox写了_TextChanged事件,选了回发
页面还有个dorpDownList也有回发事件,
当我在TextBox内添完后马上点DroptDownList,
页面马上变成白色了,,怎么办?
----------------------------------------------------
这两个事件的动作有先后撒
TextBox内添完后马上点DroptDownList
让两个事件都触发同一个方法 在这方法里面判断是哪一个事件触发的
再把这方法同步锁定 或 延时触发


用 lock{ }方法先同步锁定了来
lock{//