Jun 15, 2014, 8:27 PM
[CLOSED] File upload Hasfile false
Code in View
Code In controller
Above code i write for upload file.but the HasFile property is always getting false.can you please let me know what is wrong there?
@using Ext.Net.MVC
@using Ext.Net
@{
ViewBag.Title = "Confirm MessageBox with ButtonsConfig - Ext.NET MVC Examples";
Layout = null;
var X = Html.X();
}
@X.ResourceManager()
<form id="fileUpload" enctype="multipart/form-data">
@(
X.FormPanel().X(0).Y(190)
.ID("f")
.BodyPadding(5)
.Border(false)
.Items
(
X.Window().Width(500).Items(
X.TabPanel().Border(false).BodyStyle("background-color: #F1F1F1;")
.Items(
// TAB PERSONAL INFORMATION
X.FormPanel().Width(550).Padding(5)
.Title("Personal Information").BodyStyle("background-color: #F1F1F1;").Border(false).Icon(Icon.UserGrayCool)
.Items
(
X.FileUploadField()
.Icon(Icon.Attach)
.ID("fuCompany_Logo_path")
.FieldLabel("Company Logo")
.AnchorHorizontal("100%")
.EmptyText("Company Logo")
.AllowBlank(false)
)
)
)
.Buttons
(
X.Button()
.Text("Save")
.ID("btnSave")
.DirectEvents(de =>
{
de.Click.Before = "return validation()";
de.Click.FormID = "fileUpload";
de.Click.Action = "save";
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Saving...";
de.Click.EventMask.MinDelay = 100;
// de.Click.After = "App.GridPanel1.getStore().reload();";
})
)
)
)
</form>
var validation = function () {
if (Ext.getCmp("f").isValid() == true) {
return true;
}
else {
return false;
}
}
Code In controller
public void save()
{
if (X.GetCmp<FileUploadField>("fuCompany_Logo_path").HasFile == true)
{
string s = string.Empty;
}
}
Above code i write for upload file.but the HasFile property is always getting false.can you please let me know what is wrong there?
Last edited by Daniil; Jun 20, 2014 at 4:21 AM.
Reason: [CLOSED]