摘要:
publicclassMyActionResult:ActionResult{publicoverridevoidExecuteResult(ControllerContextcontext){context.HttpContext.Response.Write("ItisMyActionResult");}}publicclassHomeController:Controller{////GET:/Home/publicActionResultIndex(stringdata){returnnewMyActionResult();}}as you can see 阅读全文
摘要:
publicclassMyActionNameSelectorAttribute:ActionNameSelectorAttribute{publicoverrideboolIsValidName(ControllerContextcontrollerContext,stringactionName,MethodInfomethodInfo){if(actionName!="Index"){controllerContext.HttpContext.Response.Redirect("Index");returnfalse;}returntrue;}} 阅读全文