public ActionResponse Index()
return Content("Hi, My name is Sam.");
Using the Content response, you can also set the following parameters:
- Content(string content)
- Content(string content, string contentType)
- Content(string content, string contentType, Encoding contentEncoding)
The contentType parameter allows you to specify a MIME type for your content. For more information, see .NET framework documentation on "Encoding" object.
Note: If your action is returning any permissive type such as "String", "Integer", "Decimal", etc., Magentrix automatically converts the response to the Content response type and streams your action's results into the client's browser.
public string MyAction()