PDA

View Full Version : سوال: ارسال نشدن فرم



sonicuser
شنبه 03 مرداد 1394, 17:54 عصر
سلام دوستان من توی یک partial view فرم ورودم رو گذاشتم اما فرمم ارسال نمیشه به کنترلل مشکل چیه؟

@using (Html.BeginForm("test", "Auth", FormMethod.Post, new { enctype = "multipart/form-data" }))
{<div id="loginModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="loginModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="loginModalLabel"><span class="light">ورود</span></h3>
</div>
<div class="modal-body">

@Html.AntiForgeryToken()

<div class="form-horizontal">

@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.userName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.userName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.userName, "", new { @class = "text-danger" })
</div>
</div>

<div class="form-group">
@Html.LabelFor(model => model.password, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.password, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.password, "", new { @class = "text-danger" })
</div>
</div>

<div class="form-group">
<div class="col-md-offset-2 col-md-10 center-align">
<input type="submit" value="ورود" class="btn btn-primary" />
</div>
</div>
</div>

</div>
</div>

}

sempay_ninjutsu
یک شنبه 04 مرداد 1394, 11:16 صبح
سلام دوستان من توی یک partial view فرم ورودم رو گذاشتم اما فرمم ارسال نمیشه به کنترلل مشکل چیه؟

@using (Html.BeginForm("test", "Auth", FormMethod.Post, new { enctype = "multipart/form-data" }))
{<div id="loginModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="loginModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="loginModalLabel"><span class="light">ورود</span></h3>
</div>
<div class="modal-body">

@Html.AntiForgeryToken()

<div class="form-horizontal">

@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.userName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.userName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.userName, "", new { @class = "text-danger" })
</div>
</div>

<div class="form-group">
@Html.LabelFor(model => model.password, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.password, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.password, "", new { @class = "text-danger" })
</div>
</div>

<div class="form-group">
<div class="col-md-offset-2 col-md-10 center-align">
<input type="submit" value="ورود" class="btn btn-primary" />
</div>
</div>
</div>

</div>
</div>

}
کنترلی که باید این به اون پاس داده بشه رو هم بزار

hrsaberi
دوشنبه 12 مرداد 1394, 10:48 صبح
در view که ظاهرا مشکلی نیست. مشکل در کنترلر شماست.