I am creating webpart to upload file. I created asp button:
<asp:Button ID="txtUpload" runat="server" Text="Upload" OnClick="txtUpload_Click" />
Then on click event of button i write
FileUpload fileUpload = new FileUpload();
But i dont get any fileopen dialog. I also wish to add filter to only select images. How can we do it? After selecting i want to upload to sharepoint document list as attachment
Update1
I have found this example link but i want it without textbox and browse button. I just want to open file dialog on click of my button