简体   繁体   中英

How to write the javascript function calling the asp.net button click() event in asp.net?

i am writting the javascript function like this

 function PreviewImg(imgFile, labelid,frameid) {
labelid.innerHTML = imgFile.value;
document.getElementById('btnupload').click();
}

Above code document.getElementById('btnupload').click(); is the error but firefox browser is supported but i have support IE8 , pls give me suggestion error is htmlfile: Access is denied.

document.getElementById('<%= btnupload.ClientID %>').click();

this one also works for me.

document.getElementById('ctl00_btnupload').click();

but you can test it by yourself. Good luck..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM