I am using the MVC 4 framework in my C# project.
I made a page that add ads in my DB (path) and the actual
image in a folder.

The code works but I want to build a safety mechanism that prevents
the page from posting the empty input file (image selector).
I found out that HTML 5 supports the "required" attribute but I still have
some problems left.

When I press the submit button (when there is no image selected) it marks
the field but the code behind (UploadAd method in UploadController) is still fired.
What is causing this?

Following images and code could make it easier to understand:

View code: <http://pastebin.com/s9eWn4zW>

Controller code + site validation: <http://oi47.tinypic.com/23leeef.jpg>