In my controller in MVC I have a method ParseAndWrite() which is called twice. Initially my view was like following.
@model dynamic
@{
ViewBag.Title = "title";
Layout = "_Layout";
}
<h2>title</h2>
@Html.ActionLink("Push me","ParseAndWrite","JsonDeserialize")
then I read this post MVC controller is being called twice and I tried to change it like following:
@model dynamic
@{
//ViewBag.Title = "title";
//Layout = "_Layout";
}
<h2>title</h2>
but anyway this is not working,and I tried to change return to null, and new EmptyResult() in my controller method but it doesn't work . Controller Method code:
public ActionResult ParseAndWrite()
{
JsonDeserializeHelper.WriteTransportCategories();
JsonDeserializeHelper.WriteBusClasses();
JsonDeserializeHelper.WriteTransportCurrectCategoryTypes();
JsonDeserializeHelper.WriteBusModelSpecs();
JsonDeserializeHelper.WriteBusModels();
JsonDeserializeHelper.WriteBusModelSpecValues();
return View();
}