Noah Blumenthal's Blog

November 4, 2008

Getting the requested Action name

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

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!

Advertisements

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:

WordPress.com Logo

You are commenting using your WordPress.com 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

Blog at WordPress.com.

%d bloggers like this: