Ovako otvaram dialog...
Code:
$("#unos_obavestenja").dialog({
width: 800,
modal: true ,
buttons: {
"Upiši obaveštenje": function () {
$("#upisi").submit();
return true;
},
"Odustani": function () {
$(this).dialog("close");
}
},
});
$("#unos_obavestenja").dialog({
width: 800,
modal: true ,
buttons: {
"Upiši obaveštenje": function () {
$("#upisi").submit();
return true;
},
"Odustani": function () {
$(this).dialog("close");
}
},
});
A ovo je view...
Code:
@model MuzickaProdavnica.EF.Obavestenja
@{
ViewBag.Title = "Test1111";
}
@Html.ValidationSummary(true, "Neuspešan unos !")
@using (Html.BeginForm("Unos", "Obavestenja", FormMethod.Post, new { id = "upisi", enctype = "multipart/form-data" }))
{
<div id="unos_obavestenja" style="display: none">
<fieldset id="fildset_unos">
<legend>Novo obaveštenje test</legend>
<div class="editor-label">
@Html.LabelFor(m => m.Naslov)
</div>
@Html.AntiForgeryToken()
<div class="editor-field">
@Html.TextBoxFor(m => m.Naslov )
@Html.ValidationMessageFor(m => m.Naslov)
</div>
@Html.AntiForgeryToken()
<div class="editor-label">
@Html.LabelFor(m => m.Tekst)
</div>
<div class="editor-field-text_unos">
@Html.EditorFor(model => model.Tekst,new { style = "width:800px; height: 300px; " })
@Html.ValidationMessageFor(m => m.Tekst)
</div>
<label for="file">Datoteka:</label>
<input type="file" name="fajl" />
</fieldset>
</div>
}
@model MuzickaProdavnica.EF.Obavestenja
@{
ViewBag.Title = "Test1111";
}
@Html.ValidationSummary(true, "Neuspešan unos !")
@using (Html.BeginForm("Unos", "Obavestenja", FormMethod.Post, new { id = "upisi", enctype = "multipart/form-data" }))
{
<div id="unos_obavestenja" style="display: none">
<fieldset id="fildset_unos">
<legend>Novo obaveštenje test</legend>
<div class="editor-label">
@Html.LabelFor(m => m.Naslov)
</div>
@Html.AntiForgeryToken()
<div class="editor-field">
@Html.TextBoxFor(m => m.Naslov )
@Html.ValidationMessageFor(m => m.Naslov)
</div>
@Html.AntiForgeryToken()
<div class="editor-label">
@Html.LabelFor(m => m.Tekst)
</div>
<div class="editor-field-text_unos">
@Html.EditorFor(model => model.Tekst,new { style = "width:800px; height: 300px; " })
@Html.ValidationMessageFor(m => m.Tekst)
</div>
<label for="file">Datoteka:</label>
<input type="file" name="fajl" />
</fieldset>
</div>
}
Kada se uradim submit forme u kontroler mi stiže prazan model a trebao bi biti popunjen.
Ako neko zna zašto se to dešava ??
Molim za pomoć.
Patak