I want all my pages to use have some viewdata. i need to get a client name from a querystring then based on that do some work and populate ViewData. my controller inherits from the controller created below. Request["client"] is giving System.NullReferenceException: Object reference not set to an instance of an object.
public abstract class ApplicationController : Controller
{
public ApplicationController()
{
string client = Request["client"];
//...etc
}
}
这是错误的?
感谢