1

Thanks for reading this.

In the _Layout.cshtml page I use the @RenderPage to call the header:

@RenderPage("/Shared/_header.cshtml")

It has this:

<div id="Header"> Home </div>

Want to make it clickable to the default action ("Index")

When I tried this:

<div id="Header"> @Html.Action("Index", MyController") </div>

I get the error:

An opening "(" is missing the corresponding closing ")" at

@RenderPage("/Shared/_header.cshtml")

Any idea?

scv
  • 323
  • 10
  • 20

1 Answers1

2

You are missing the opening double-quote on MyController.

It should be:

<div id="Header"> @Html.Action("Index", "MyController") </div>
Miroslav Popovic
  • 12,100
  • 2
  • 35
  • 47
  • oh crap; I'm blind ... So, I entered the double quote and I get this error: The 'Action' is underlined in red with this error: 'System.Web.WebPages.Html.HtmlHelper' does not contain a defintion for 'Action' and no extension ...... – scv Jun 08 '12 at 20:34
  • Try to use RenderPartial instead of RenderPage: http://stackoverflow.com/questions/4501736/razor-html-partial-vs-renderpage – Miroslav Popovic Jun 08 '12 at 20:50