C# - How To Get RouteData In Application_EndRequest

Oct 26, 2010

I am building a simple performance logger that hooks in to Application_EndRequest / Application_BeginRequest

I would like to send my logger the name of the action and controller as some sort of key.

How can I access this information? (Don't mind if I have to intercept it earlier on and keep it around in the context)

View 1 Replies


Similar Messages:

Application_EndRequest Still Fire On Error?

Oct 4, 2010

I need to dispose of some resources at the end of each request...am I safe to just use Application_EndRequest or if something crashes will that not be hit (should I have the dispose code in Application_Error as well?)

View 2 Replies

Retrieving Webmethod Parameter Values From Application_BeginRequest Or Application_EndRequest

Jun 16, 2010

Is there a way to retrieving parameter names and values passed to a web method from Request object? I've read somewhere that you need extra code to access the soap body. Any known workarounds to be able to see the soap body from Application_BeginRequest?

View 1 Replies

How To Get Route Name From RouteData

Oct 17, 2010

I have several routes defined in my Global.asax; now, when I'm on a page I need to figure out what is the route name of the current route, because route name drives my site menu. I can't find a way to get current route name.

View 4 Replies

How To Access RouteData From Within An ASHX

Jun 29, 2010

My web site has a handler (FileDownload.ashx) that deals with all file download requests. I've recently migrated my site to ASP.Net 4.0, and it now uses routing extensively. Everything works fine when dealing with page requests (aspx), but it's not working with my handler - I encounter the following error:

Type '<snip>.Handlers.FileDownload' does not inherit from 'System.Web.UI.Page'.

This makes sense, as routing is only implemented in the page. So, my question is, what steps do I need to take to be able to use routing and my ASHX together? I want to be able to extract RouteData.Values from the url.

public class FileDownload : IHttpHandler
{
}

View 2 Replies

MVC :: Create A RouteData From URL String?

Jan 7, 2011

Is there any ways to create our own RouteData from a URL string in asp.net mvc?

for example I have a URL string like this.

Url: http://localhost/supports/online chat?operator=A

From RouteData, I can find what is controller and action name.

but I have no idea to put it in RouteData.

View 3 Replies

MVC :: Can't Access RouteData.DataTokens From Application_AuthorizeRequest

Jul 29, 2010

Although I'm not using routing in an MVC application, this post seems to fit best here :)

I'm trying to access the datatokens that I've passed with the MapPageRoute-method and in a simple Webforms page it works, but in Application_AuthorizeRequest it seems like it's not populated yet.. DataTokens.Count returns 0 although I have passed one item

Is there an alternate way to access the DataTokens? The routing has initialized (it seems), because there's a major difference between url's that is mapped and one that's not..

From the regular Webforms page I'm using Page.RouteData.DataTokens["PagesID"] and in the global.asax file I'm using Request.RequestContext.RouteData.DataTokens["PagesID"]

View 10 Replies

MVC :: How To Access MVC RouteData In NinjectHttpApplication CreateKernel

Mar 30, 2011

How I can access the mvc RouteData in the CreateKernel override when using ninject.web.mvc extension and inheriting NinjectHttpApplication?

[Code]....

View 3 Replies

Data Controls :: Get RouteData Value Inside WebMethod In URL Routing?

Aug 18, 2015

[System.Web.Services.WebMethod]
public static string GetChapterDetails()
{

[Code]....

I am trying to get the ID but its giving me null all the time

I am then binding them in my AJAX

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved