Asp.net - Create a custom File Upload Control from scratch
I have tried using the FileUpload control in ASP.net and found some strange problems. I have decided to scrap this control and create a custom control. Is it possible to create 开发者_StackOverflow中文版a file upload control from scratch?
thanks
AsyncFileUpload is an ASP.NET AJAX Control that allows you asynchronously upload files to server. The file uploading results can be checked both in the server and client sides. You can save the uploaded file by calling the SaveAs() method in a handler for the server UploadedComplete event.
Check out this: http://www.asp.net/ajax/ajaxcontroltoolkit/samples/AsyncFileUpload/AsyncFileUpload.aspx
Yes, it's possible. Essentially your control will just have to render an input
tag with a type of file, e.g.:
protected override void Render(HtmlTextWriter output)
{
output.Write("<input type='file' />");
}
However, this is a gross simplification of the problem...!
精彩评论