Friday, 1 January 2016

How to return Javascript from an ASP.NET MVC controller action

We can use ContentResult to return the content from the MVC controller action method

Public ActionResult Helloworld()
{
    return Content("<script language='javascript' type='text/javascript'>alert('Hello world!');
}

No comments:

Post a Comment

Extracting Nupkg files using command line

Rename it to zip first then extract files as below 1.     Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2.     Make sure to repla...