hmk
hmk

Reputation: 969

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.

Upvotes: 1

Views: 3176

Answers (2)

mrjurin
mrjurin

Reputation: 136

this one also works for me.

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

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

Upvotes: 2

rick schott
rick schott

Reputation: 21117

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

Upvotes: 2

Related Questions