¡@

Home 

c# Programming Glossary: routedata

How to unit-test an MVC controller action which depends on authentification in c#?

http://stackoverflow.com/questions/1106398/how-to-unit-test-an-mvc-controller-action-which-depends-on-authentification-in-c

new ControllerContext context.Object new RouteData controller test ViewResult viewResult ViewResult controller.SomeAction..

ASP.NET MVC Custom Error Handling Application_Error Global.asax?

http://stackoverflow.com/questions/1171035/asp-net-mvc-custom-error-handling-application-error-global-asax

exception as HttpException if httpException null RouteData routeData new RouteData routeData.Values.Add controller Error.. if httpException null RouteData routeData new RouteData routeData.Values.Add controller Error switch httpException.GetHttpCode..

How do I mock the HttpContext in ASP.NET MVC using Moq?

http://stackoverflow.com/questions/1452418/how-do-i-mock-the-httpcontext-in-asp-net-mvc-using-moq

ASP.Net MVC RouteData and arrays

http://stackoverflow.com/questions/1752721/asp-net-mvc-routedata-and-arrays

MVC RouteData and arrays If I have an Action like this public ActionResult..

URL Routing across multiple subdomains

http://stackoverflow.com/questions/3243045/url-routing-across-multiple-subdomains

exist. public class ExampleRoute RouteBase public override RouteData GetRouteData HttpContextBase httpContext var url httpContext.Request.Headers.. class ExampleRoute RouteBase public override RouteData GetRouteData HttpContextBase httpContext var url httpContext.Request.Headers.. null var subDomain url.Substring 0 index var routeData new RouteData this new MvcRouteHandler routeData.Values.Add controller subdomain..

How can I return the current action in an ASP.NET MVC view?

http://stackoverflow.com/questions/362514/how-can-i-return-the-current-action-in-an-asp-net-mvc-view

this question Use the ViewContext and look at the RouteData collection to extract both the controller and action elements...

Is there a way to process an MVC view (aspx file) from a non-web application?

http://stackoverflow.com/questions/3702526/is-there-a-way-to-process-an-mvc-view-aspx-file-from-a-non-web-application

controllerName controller.GetType .Name var routeData new RouteData routeData.Values.Add controller controllerName.Remove controllerName.LastIndexOf..

Mock HttpContext.Current in Test Init Method

http://stackoverflow.com/questions/4379450/mock-httpcontext-current-in-test-init-method

new ControllerContext new RequestContext httpContext new RouteData controller controller.ControllerContext context public static.. new ControllerContext new RequestContext httpContext new RouteData controller controller.ControllerContext context This test class..

How to determine if an arbitrary URL matches a defined route

http://stackoverflow.com/questions/4748342/how-to-determine-if-an-arbitrary-url-matches-a-defined-route

application path and uses that to obtain an instance of RouteData based on the new HttpContext object. I can then evaluate the.. ROUTEINFO CLASS public class RouteInfo public RouteInfo RouteData data RouteData data public RouteInfo Uri uri string applicationPath.. public class RouteInfo public RouteInfo RouteData data RouteData data public RouteInfo Uri uri string applicationPath RouteData..

Asp.net mvc override OnException in base controller keeps propogating to Application_Error

http://stackoverflow.com/questions/6324368/asp-net-mvc-override-onexception-in-base-controller-keeps-propogating-to-applica

HttpException httpException exception as HttpException RouteData routeData new RouteData routeData.Values.Add controller Error.. exception as HttpException RouteData routeData new RouteData routeData.Values.Add controller Error if httpException null..

Setting the httpcontext current session in unit test

http://stackoverflow.com/questions/9624242/setting-the-httpcontext-current-session-in-unit-test

.Returns requestContext.Object requestContext.Setup x x.RouteData .Returns new RouteData request.SetupGet req req.Headers .Returns.. requestContext.Setup x x.RouteData .Returns new RouteData request.SetupGet req req.Headers .Returns new NameValueCollection..

ASP.NET MVC Custom Error Handling Application_Error Global.asax?

http://stackoverflow.com/questions/1171035/asp-net-mvc-custom-error-handling-application-error-global-asax

as HttpException if httpException null RouteData routeData new RouteData routeData.Values.Add controller Error switch httpException.GetHttpCode.. if httpException null RouteData routeData new RouteData routeData.Values.Add controller Error switch httpException.GetHttpCode.. httpException.GetHttpCode case 404 page not found routeData.Values.Add action HttpError404 break case 500 server error..

ASP.Net MVC RouteData and arrays

http://stackoverflow.com/questions/1752721/asp-net-mvc-routedata-and-arrays

helper string text string action string controller object routeData object htmlAttributes var urlHelper new UrlHelper helper.ViewContext.RequestContext.. string href urlHelper.Action action controller if routeData null RouteValueDictionary rv new RouteValueDictionary routeData.. null RouteValueDictionary rv new RouteValueDictionary routeData List string urlParameters new List string foreach var key in..

How can I get controller type and action info from a url or from route data?

http://stackoverflow.com/questions/2690779/how-can-i-get-controller-type-and-action-info-from-a-url-or-from-route-data

info The only solution I have so far is something like var routeData RouteTable.Routes.GetRouteData actionExecutingContext.HttpContext.. var routeController string routeData.Values controller var routeAction string routeData.Values action.. string routeData.Values controller var routeAction string routeData.Values action The problem with this is that routeController..

URL Routing across multiple subdomains

http://stackoverflow.com/questions/3243045/url-routing-across-multiple-subdomains

0 return null var subDomain url.Substring 0 index var routeData new RouteData this new MvcRouteHandler routeData.Values.Add.. var routeData new RouteData this new MvcRouteHandler routeData.Values.Add controller subdomain attempts to go to controller.. attempts to go to controller action of the subdomain routeData.Values.Add action Index Goes to the Index action on the User2Controller..

Is there a way to process an MVC view (aspx file) from a non-web application?

http://stackoverflow.com/questions/3702526/is-there-a-way-to-process-an-mvc-view-aspx-file-from-a-non-web-application

var controllerName controller.GetType .Name var routeData new RouteData routeData.Values.Add controller controllerName.Remove.. controller.GetType .Name var routeData new RouteData routeData.Values.Add controller controllerName.Remove controllerName.LastIndexOf.. controllerName.LastIndexOf Controller routeData.Values.Add action index var controllerContext new ControllerContext..

Better way to get active page link in MVC 3 Razor

http://stackoverflow.com/questions/6323021/better-way-to-get-active-page-link-in-mvc-3-razor

action string controller var li new TagBuilder li var routeData htmlHelper.ViewContext.RouteData var currentAction routeData.GetRequiredString.. htmlHelper.ViewContext.RouteData var currentAction routeData.GetRequiredString action var currentController routeData.GetRequiredString.. routeData.GetRequiredString action var currentController routeData.GetRequiredString controller if string.Equals currentAction..

Asp.net mvc override OnException in base controller keeps propogating to Application_Error

http://stackoverflow.com/questions/6324368/asp-net-mvc-override-onexception-in-base-controller-keeps-propogating-to-applica

httpException exception as HttpException RouteData routeData new RouteData routeData.Values.Add controller Error if httpException.. as HttpException RouteData routeData new RouteData routeData.Values.Add controller Error if httpException null routeData.Values.Add.. controller Error if httpException null routeData.Values.Add action PublicError else It's an Http Exception..