0

I must be missing something obvious. I have a view A in controller B that needs to call and render an action method Y in controller Z.

Should I be doing something like this in view A ? I'm getting errors in VS about how it can't resolve action '/Z/Y'

@Html.RenderAction("/Z/Y", new ModelUsedInActionMethodY())

1 Answer 1

3

You need to use:

@Html.RenderAction("Y", "Z")

This will route to Action Method Y in ZController. See the MSDN documentation for a complete list of method signatures for Html.RenderAction().

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.