Updated on Kisan Patel
To output any content (plain text or HTML text) from controller, we use ContentResult()
like below.
public ContentResult OutputContent() { return Content("This content is From Controller."); }
Here, we are returning data using the Content function by passing the data as string as return Content.