这是我的代码" btnviewreport1"页面加载后不会触发
<script type="text/javascript">
$(document).ready(function () {
var hfDoYouWantPrint = document.getElementById('<%= hfDoYouWantPrint.ClientID %>').value;
if (hfDoYouWantPrint == 1) {
var r = confirm("Do you want to print?");
if (r == true) {
document.getElementById('<%= btnviewreport1.ClientID %>').click();
} else {
}
}
});
</script>
答案 0 :(得分:0)
你必须使用Trigger而不是调用&#39; click()&#39;方法
见下文
document.getElementById('').trigger('click');
&#13;