Home > DeveloperSection > Forums > How do return string string result in Asp.Net MVC ?
Simons Hood
Simons Hood

Total Post:70

Points:494
Posted on    October-07-2014 12:53 AM

 ASP.NET MVC ASP.Net  ASP.NET MVC 
Ratings:


 1 Reply(s)
 709  View(s)
Rate this:

In my ajax call, I want to return a string value back to the calling page.

Should I use ActionResult or just return a string?



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    October-07-2014 12:54 AM

You can just use the ContentResult to return a plain string.

public ActionResult Temp()

        {

            return Content("Hi there!");

        }


Don't want to miss updates? Please click the below button!

Follow MindStick