Upload files with jqxFileUpload to ASP.NET web form
In this help topic we are going to show you how to connect jqxFileUpload to ASP.NET web form.
- Create a new ASP.NET Web Application.
- Add the following files to the Scripts folder.
jqxcore.js, jqxbuttons.js, jqxfileupload.js and jquery-1.11.1.min.js.
- In the "Styles" folder add the "jqx.base.css" CSS file.
- Add a new web form to the website. Right click on your project’s name. Then choose "Add -> New Item -> Web Form". For example call it "FileUpload". This will create a FileUpload.aspx file which we will use for the serverside code to handle our file upload.
Add these additional dependancies after the already included ones:
Use the following code for the Page_load function:
This page will be responsible for the post requests sent by our client page. It is configured to accept image mime types, and only with extensions .jpg, .jpeg, .bmp, .png and .gif. It works for single and multiple uploads since jqxFileUpload sends the files one by one.
You need to create a folder named "uploads" inside the project directory to store the uploaded files.
Now let's add an example.htm file to our project to test the page with the following code.
While having the example.htm file active in the solution explorer press F5 in Visual Studio to run and test your project.