I have created a custom editor template for “input file” in MVC3.
I want to bind this custom made editor template to a on change event that validates the file input with Java Script. What I want to do is when browsing a input file I want to validate the file-name as soon as I have chosen the file without having to submit the page first.
So what is the best way to bind a event to a custom template?
Well, you could add
some.jsto your page in which you subscribe to the change event unobtrusively: