Jun 01, 2012, 9:39 AM
[CLOSED] [MVC] FileUpload in MVC
Hi, Could you give me an axample for using FileUpload in MVC?
Html.X().FormPanel()
.Border(false)
.ID("UploadForm")
.Items(itm =>
{
itm.Add(Html.X().TextField().FieldLabel("Name"));
itm.Add(Html.X().FileUploadField().FieldLabel("Select new document").Icon(Icon.Attach));
itm.Add(Html.X().TextField().FieldLabel("Description"));
})
.Listeners(l => l.ValidityChange.Handler = "#{SaveButton}.setDisabled(!valid);")
.Buttons(btn =>
{
btn.Add(Html.X().Button().ID("SaveButton").Text("Upload").Disable(true)
.OnClientClick("doUpload();")
.DirectEvents(d =>
{
d.Click.Before = "if (!#{UploadForm}.getForm().isValid()) { return false; } Ext.Msg.wait('Uploading ...', 'Uploading');";
d.Click.Failure = "Ext.Msg.show({ title : 'Error',msg : 'Error during uploading',minWidth: 200,modal : true,icon : Ext.Msg.ERROR,buttons : Ext.Msg.OK });";
}));
btn.Add(Html.X().Button().Text("Reset").Listeners(ls => ls.Click.Handler = "#{UploadForm}.getForm().reset();"));
}))
What must I add to this view and the controller?
Last edited by Daniil; Jun 08, 2012 at 2:22 PM.
Reason: [CLOSED]