How can i return Json string from this ?

Category: Art & Design

How can i return Json string from this ? And then use the json to use a ajax.public ActionResult RateMovie(FormCollection collection){string movieId = collection[“movieid”];string rateInfo = collection[“rateinfo”];if (String.IsNullOrEmpty(movieId)){return View(“Error”);}if(String.IsNullOrEmpty(rateInfo)){ return RedirectToAction(“Detail”, “MovieApp”, new { id = movieId });}string username = System.Security.Principal.WindowsIdentity.GetCurrent().Name;int id = Int32.Parse(movieId);Rating rating = MovieAppRepository.Instance.GetRatingsByID(id).Where(x => x.Username == username).SingleOrDefault();if(rating != null){rating.rating = Int32.Parse(rateInfo);}else {Rating newRating = new Rating { MovieId = id, rating = Int32.Parse(rateInfo), Username = username };MovieAppRepository.Instance.AddRating(newRating);}return RedirectToAction(“Detail”, “MovieApp”, new { id = movieId });/*$(document).ready(function () {$(“#movieID”).submit(function () {$.ajax({type: “POST”,contentType: “application/json; charset=utf8”,url: “/MovieApp/ReviewMovie/”,data: $(“movieID”).serialize(),dataType: “json”,success: function (data) {alert(“Pulla og kók með sveppa krull”)},});event.preventdefault();});});}

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Pay Someone To Write Essay