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
Dr.Ajay Kashyap
NA
521
284.1k
How To Pass Array through Json In MVC
Feb 7 2017 9:50 AM
I want to pass Array Through json
<script type="text/javascript">
$("#Category").focusout(function () {
debugger;
var Category1 = $("input[name='[0].Category']").val();
var Category2 = $("input[name='[1].Category']").val();
var Category3 = $("input[name='[2].Category']").val();
var Category4 = $("input[name='[3].Category']").val();
var Category5 = $("input[name='[4].Category']").val();
var allcat = [ Category1, Category2, Category3, Category4, Category5 ];
var url = '@Url.Action("CheckCategory_Name", "CategoryAndSubCategory")';
$.getJSON(url, {Total :allcat }, function (data) {
if (data.isDuplicate == true) {
$("#Category").val("");
swal("The Category Name Is Already Exist");
return false;
}
});
});
</script>
[HttpGet]
public JsonResult CheckCategory_Name(string[] Total)
{
bool isDuplicate = false;
var categoryname = db.MasterCategories.ToList();
var jsonData = new { isDuplicate };
return Json(jsonData, JsonRequestBehavior.AllowGet);
}
Reply
Answers (
1
)
how to store Login User Id and use over an application?
Snapdeal affiliate API integration in MVC 4 application