asp.net中启用了btn的属性语句执行问题 [英] btn enabled property statement execution problem in asp.net

查看:60
本文介绍了asp.net中启用了btn的属性语句执行问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我写btnExcel.Enabled = true;在下面的语句之后,为什么不执行.

收合|复制代码

Rpt.ExportToHttpResponse(ExportFormatType.Excel,Response,true,"Report");




收合|复制代码

Rpt.ExportToHttpResponse(ExportFormatType.Excel,Response,true,"Report");

btnExcel.Enabled = true;



好的,有人给了我解决方案

那是

收合|复制代码

它会覆盖响应对象,因此按钮的禁用部分不会包含在响应对象中.因此请在此事件之前或之后使用javascript禁用按钮.

我在此事件之前或之后使用javascript禁用了按钮.

if i write btnExcel.Enabled = true; after below statement then why not executed.

Collapse | Copy Code

Rpt.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Report");


ie.

Collapse | Copy Code

Rpt.ExportToHttpResponse(ExportFormatType.Excel, Response, true, "Report");

btnExcel.Enabled = true;



ok someone gave me solution

that is

Collapse | Copy Code

It overrides the response object so the disabled portion of the button is not getting included in the response object. so use javascript before or after this event to disable the button.

i use javascript before or after this event to disable the button.
still not working?

推荐答案

而不是设置enable,而是禁用Button的属性use style.dispaly
< asp:button id ="bt1" runat ="Server" style ="display:none;" xmlns:asp =#unknown">
不要使用按钮的可见属性.之后,在您的.js文件中,您需要执行以下代码:-
document.getElementById(''<%= bt1.ClientID%>'').style.display ="block";
instead of setting enable, disable property of Button use style.dispaly
<asp:button id="bt1" runat="Server" style="display: none;" xmlns:asp="#unknown">
Do not use Visible property of button. after that in your .js file you need to do these codes :-
document.getElementById(''<%= bt1.ClientID %>'').style.display = "block";


这篇关于asp.net中启用了btn的属性语句执行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆