TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chintan Goswami
NA
68
446
How To bind Json data in @HTML View .
Aug 8 2018 7:59 AM
Controller Code
public
ActionResult EditState(
int
id)
{
StateModel sm =
new
StateModel();
var state = sm.EditState(id);
if
(state !=
null
)
{
return
Json(state, JsonRequestBehavior.AllowGet); }
else
{
return
null
;
}
//return View();
}
View Code
@model VizioCRM.Models.State
@{
ViewBag.Title =
"EditState"
;
Layout =
"~/Views/Shared/_Layout.cshtml"
;
}
<h2>EditState</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div
class
=
"form-horizontal"
>
<h4>State</h4>
<hr />
@Html.ValidationSummary(
true
,
""
,
new
{ @
class
=
"text-danger"
})
@Html.HiddenFor(model => model.StateID)
<div
class
=
"form-group"
>
@Html.LabelFor(model => model.StateName, htmlAttributes:
new
{ @
class
=
"control-label col-md-2"
})
<div
class
=
"col-md-10"
>
@Html.EditorFor(model => model.StateName,
new
{ htmlAttributes =
new
{ @
class
=
"form-control"
} })
@Html.ValidationMessageFor(model => model.StateName,
""
,
new
{ @
class
=
"text-danger"
})
</div>
</div>
<div
class
=
"form-group"
>
<div
class
=
"col-md-offset-2 col-md-10"
>
<input type=
"submit"
value=
"Save"
class
=
"btn btn-default"
/>
</div>
</div>
</div>
}
<div>
@Html.ActionLink(
"Back to List"
,
"Index"
)
</div>
Reply
Answers (
1
)
Error: The command exited with code 9009
datepicker issue