Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7592591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:56:42+00:00 2026-05-30T20:56:42+00:00

I have a layout page with the following _app.cshtml <div id=top_right> @{ Html.Partial(_LogOnPartial); }

  • 0

I have a layout page with the following

_app.cshtml

<div id="top_right">
    @{ Html.Partial("_LogOnPartial"); }
</div>

The log on partial contains

_LogOnPartial.cshtml

@{
    Layout = null;
}

@if (Request.IsAuthenticated)
{
    Html.RenderAction("Details", "Account");
}
else
{
    Html.RenderAction("LogOn", "Account");
}

and the render action method im expecting to see is

AccountController.cs

public class Account
{  
        public PartialViewResult LogOn()
        {
            return PartialView();
        }
}

the Logon partial view that would be returned by Account/LogOn is

LogOn.cshtml

@model Presentation.Models.LogOnModel

<div id="login">
    @Html.ValidationSummary()

    <h2>Start by Loggin in</h2>

    @using (Html.BeginForm("LogOn", "Account"))
    {
        @Html.Hidden("returnUrl", Request.Url.PathAndQuery)

        <table width="100%" border="0" cellspacing="0" cellpadding="5">
            <tr>
                <td>
                    <span class="bluey">Username:</span><br />
                    @Html.TextBoxFor(m => m.UserName, new {tabindex = "1", Class = "field"})
                    @Html.ValidationMessageFor(m => m.UserName, "*")
                </td>
                <td>
                    <span class="bluey">Password:</span><br />
                    @Html.TextBoxFor(m => m.Password, new {tabindex = "2", Class = "field"})
                    @Html.ValidationMessageFor(m => m.Password, "*")
                </td>
            </tr>
            <tr>
                <td>
                    <input name="login" type="submit" value="Submit" class="input_btn" tabindex="3" />
                </td>
                <td>@Html.CheckBoxFor(m => m.RememberMe) @Html.LabelFor(m => m.RememberMe) <span class="bluey">&nbsp; | &nbsp;</span> @Html.ActionLink("Forgot Password?", "Password", "User")></td>
            </tr>
        </table>
    }
</div>

I have traced the flow through and I can see it is hitting the

Html.RenderAction("LogOn", "Account")

and returning the partial view from there however when I view the page none of the html of the partial view (LogOn.cshtml) is rendered, it isn’t even present in the source.

Am I missing something fundamental here, is there a better way to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:56:43+00:00Added an answer on May 30, 2026 at 8:56 pm

    You have a code block which will be returning the partial rather than outputting it, change:

    <div id="top_right">
        @{ Html.Partial("_LogOnPartial"); }
    </div>
    

    to:

    <div id="top_right">
        @Html.Partial("_LogOnPartial");
    </div>
    

    Alternatively, use Html.RenderPartial to output it directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page layout, PeopleSearchResults.aspx programmed by someone else. It contains the following
I have the following in web layout (master page): @(Html.Telerik().ScriptRegistrar() .DefaultGroup(group => group .DefaultPath(~/Assets/telerikaspnetmvc/2011.2.712/Scripts/)
I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page
I have a div in which a page is loaded with the DojoX Layout
I have the following elements in my page: <!doctype html> <html xmlns=http://www.w3.org/1999/xhtml xmlns:og=http://ogp.me/ns# xmlns:fb=https://www.facebook.com/2008/fbml>
In my Layout page, i have the following links to the validation Javascript files,
I have the following page layout using the 960 grid systm ---------------- header -----------------
I have a page layout for my MOSS '07 site that I want put
I have a page layout that I use in my SharePoint solution when I
I have this big data-entry sort of page, a table kind of layout using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.