试图使asp:ImageButton为非c;在UpdatePanel部分回发期间可点击 [英] Trying to make a asp:ImageButton non-c;lickable during UpdatePanel partial postback
问题描述
我正在尝试创建一个具有三个相互过滤的下拉菜单的表单,并且还有一个asp:ImageButton
,上面写有重新开始",可以清除过滤器并从头开始重新绑定下拉菜单.三个下拉菜单和按钮都位于设置了UpdateMode="Always"
的asp:UpdatePanel
中.
问题是,我不希望用户在部分回发过程中单击重新开始"按钮,因为否则会破坏数据绑定.唯一的问题是,我尝试在JavaScript中设置disabled=true
,它使按钮不可单击,但是当我再次使它可单击时,服务器端的OnClick事件将不会触发.但这似乎是有原因的,因为即使我似乎没有任何反应,单击浏览器的刷新"按钮,也会重新加载整个页面,就像单击了重新开始按钮一样.
由于客户的要求,除了asp:ImageButton
之外,无法执行其他任何操作.有人请帮忙.谢谢.
Brian
I am trying to make a form that has three drop downs that filter each other and there is also a asp:ImageButton
that says "Start Over" that clears out the filters and re-binds the drop downs from scratch. The three drop downs and button are all in a asp:UpdatePanel
with UpdateMode="Always"
set.
Thing is, I don''t want the user to be able to click the "Start Over" button during the partial postback because otherwise that screws up the databinding. Only problem is, i''ve tried setting disabled=true
in JavaScript and it makes the button non-clickable but then the OnClick event on the server side won''t fire when I make it clickable again. But it seems to fire because, even though nothing seems to happen, if I click the browser''s "Refresh" button, the whole page reloads and it''s as if the start over button was clicked.
Can''t do it any other way besides asp:ImageButton
because of a client requirement. Anybody please help. Thank you.
Brian
推荐答案
<style>
#UpdateProgress1
{
color:#fff;
top:0px;
right:0px;
position:fixed ;
width:100%;
height:100%;
}
#UpdateProgress1 img
{
vertical-align :middle;
margin:2px;
}
#UpdateProgress1 div
{
background-color:Gray;
opacity:0.4;
filter:alpha(opacity=40);
}
</style>
aspx页面的代码
//////////////
code for aspx page
////////////////
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" >
<ProgressTemplate>
<div >
<img src ="images/loading3.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
这篇关于试图使asp:ImageButton为非c;在UpdatePanel部分回发期间可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!