PDA

View Full Version : این ارور واسه post اطلاعات داره انجام میشه...!!!



RIG000
پنج شنبه 18 مهر 1392, 10:01 صبح
Server Error in '/' Application.

The view 'UserCreate' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/UserCreate.aspx
~/Views/Home/UserCreate.ascx
~/Views/Shared/UserCreate.aspx
~/Views/Shared/UserCreate.ascx
~/Views/Home/UserCreate.cshtml
~/Views/Home/UserCreate.vbhtml
~/Views/Shared/UserCreate.cshtml
~/Views/Shared/UserCreate.vbhtml

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The view 'UserCreate' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/UserCreate.aspx
~/Views/Home/UserCreate.ascx
~/Views/Shared/UserCreate.aspx
~/Views/Shared/UserCreate.ascx
~/Views/Home/UserCreate.cshtml
~/Views/Home/UserCreate.vbhtml
~/Views/Shared/UserCreate.cshtml
~/Views/Shared/UserCreate.vbhtml

RIG000
پنج شنبه 18 مهر 1392, 10:03 صبح
وقتی دکمه ثبت user رو میزنم به action من نمیرسه!!!! و این ارور رو میده!!! اصلا" null نباید مثلا بفرسته ... یعنی هیج ارور null بودن نمیده...
و این صفحه ظاهر میشه...

RIG000
پنج شنبه 18 مهر 1392, 10:05 صبح
@model Toranj_Co.Models.tblUser

@{
ViewBag.Title = "GetUser";
}

<h2>GetUser</h2>

@using (Html.BeginForm("UserCreate", "Home", FormMethod.Post, new {id="MyForm" }))
{
@Html.ValidationSummary(true)

<fieldset>
<legend>tblUser</legend>

<div class="editor-label">
@Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Lname)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Lname)
@Html.ValidationMessageFor(model => model.Lname)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.UserName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.UserName)
@Html.ValidationMessageFor(model => model.UserName)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Password)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Password)
@Html.ValidationMessageFor(model => model.Password)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Email)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Email)
@Html.ValidationMessageFor(model => model.Email)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Address)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Address)
@Html.ValidationMessageFor(model => model.Address)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.City)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.City)
@Html.ValidationMessageFor(model => model.City)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Mobile)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Mobile)
@Html.ValidationMessageFor(model => model.Mobile)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Tell)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Tell)
@Html.ValidationMessageFor(model => model.Tell)
</div>

<div class="editor-label">
@Html.LabelFor(model => model.InsertDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.InsertDate)
@Html.ValidationMessageFor(model => model.InsertDate)
</div>

<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}

<div>
@Html.ActionLink("Back to List", "Index")
</div>

RIG000
پنج شنبه 18 مهر 1392, 10:27 صبح
[HttpPost]
public ActionResult UserCreate(Models.tblUser entity)
{
ToranjNameSpace.UserInsert(entity);
return RedirectToAction("Index");
}

star_rh
پنج شنبه 18 مهر 1392, 10:38 صبح
کنترل UserCreate رو نمی تونه پیدا کنه. مطمئن شو که ایجادش کردی

RIG000
پنج شنبه 18 مهر 1392, 11:35 صبح
ممنون درستش کردم...
حروف رو اشتباه زده بودم .. .