I get this error when compiling: Error-CS0103 "The name" HtmlEncode "does not exist in the current context"
I am using Visual Studio 2015 Community Edition and MVC.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
namespace MvcMovie.Controllers
{
public class HelloWorldController : Controller
{
public string Index()
{
return "This is my default action...";
}
public string Welcome(string name, int numTimes = 1)
{
return HtmlEncoder.Default.HtmlEncode(
"Hello " + name + ", NumTimes is: " + numTimes);
}
}
}
I can not find the HtmlEncoder link for the links. Do you see what I'm doing wrong?
Thanks!
source
share