Coppermill
Coppermill

Reputation: 6804

ascx MVC controller need to know the calling Controller

I have an MVC View User Control and from with Controller I would like to find out what the name of the controller that the MVC View User Control has been called from.

Hope that makes sense?

Upvotes: 1

Views: 794

Answers (1)

Çağdaş Tekin
Çağdaş Tekin

Reputation: 16661

This should do it :

<%=ViewContext.RouteData.Values["controller"] %>

Upvotes: 2

Related Questions