1

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?

1

1 Answer 1

2

This should do it :

<%=ViewContext.RouteData.Values["controller"] %>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.