HOW DO RETURN STRING STRING RESULT IN ASP.NET MVC ?

Simons Hood

Total Post:70

Points:494
Posted by  Simons Hood
 1066  View(s)
Ratings:
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?

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: How do return string string result in Asp.Net MVC ?

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

    public ActionResult Temp()

            {

                return Content("Hi there!");

            }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!