Noah Blumenthal's Blog

November 4, 2008

Getting the requested Action name

Filed under: ASP.NET MVC — noahblu @ 10:54 pm

Today I needed to retrieve the name of the current Action from within a View.

Shebam: ViewContext.RouteData.GetRequiredString(“action”) .  That’ll get you the name of the currently executed Action.  You can then use that with Html.ActionLink to make links Action sensitive!  Awesome!


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: