Raising an event in code

D

Don W

I want to use the browse functionality of the asp:filedownload control
programatically without the client clicking on the asp:filedownload browse
button(FileDownload1.visible=false.) How does one raise the OnClick event of
the asp:filedownload control programatically?
 
B

bruce barker

setting visible false causes the control to not render. try:

<asp:FileUpload ID="file1" runat="server" style="display:none;"/>
<button onclick="document.getElementById('file1').click();">click
me</button>

-- bruce (sqlwork.com)
 
D

Don W

Thank you, Bruce! This is exactly what I needed. Don't know why I didn't
think of that, but it's exactly what I was trying to do.

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top