2

I have a Controller called ActivationController with a LogOn action, which renders the view LogOn.aspx. LogOn.aspx renders a partial view called LogOn.ascx:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    LogOn
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Account Activation Step 1 - Log On</h2>

    <p>
        <%Html.RenderPartial("LogOn")<;%>
    </p>

</asp:Content>

When calling the action i'm getting a "Stack Overflow" exception:

An unhandled exception of type 'System.StackOverflowException' occurred in System.Web.Mvc.dll

Any clue?

Thanks in advance!

1

2 Answers 2

6

Don't bother to reply, i found the issue.

The problem was that partial view should have a different name than the view. :P

Thanks anyway!!

Sign up to request clarification or add additional context in comments.

Comments

1

This looks wrong:

<%Html.RenderPartial("LogOn")<;%>

it should look like this:

<% Html.RenderPartial("LogOn");%>

Comments

Your Answer

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