views:

112

answers:

2

I am very new to MVC.
I've been learning to use plain HTML or HtmlHelpers, eg. for textbox, and get the value back in the Controller using Request.Form.

But how do I use .NET controls with MVC? (eg. FileUpload)

(The reason I ask is I am trying to use a custom control for uploading multiple files - it's Flajaxian File Uploader, if anyone knows about it.
It works with webforms, but I have no idea how this thing is gonna work with MVC.)

Thanks in advance

+5  A: 

You won't be able to use regular ASP.NET controls on MVC, because all of these are dependent on the ASP.NET Page Lifecycle, which MVC explicitly avoids.

Your best bet is to check out various jQuery controls and use those for your web application.

Jon Limjap
Thanks. What about creating a separate webform only for the upload page? (Just because I am familiar with flajaxian) Can it be done / is it easy / is it a good idea?
You can mix MVC and WebForms in a single project but it's not as easy as just adding it. Also I think mixing them is a bad idea especially for a single page. Would be a whole lot quicker to write a new MVC page than to integrate WebForms and MVC IMHO
griegs
+2  A: 

Further to what @Jon said this one seems to be pretty popular.

uploadify

Also try this for a list of multi file upload plugins.

griegs
I've used uploadify before and it's really good. Definitely worth a look.
Damovisa
Thanks, can uploadify be used with MVC?
@aximili, yes it can else i'd not have mentioned it. You basically need to deal with jQuery plugins with MVC as all the WebForm controls are out of the question.
griegs
Thanks again Greigs :)I'm trying it out now
oh thanks Greigs I actually found the answer and deleted my question, I dind't realise you were answering it. You can do something after the uploads are finished by using the onAllComplete function.