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

  • Home
  • SEARCH
  • 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 6631207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:30:48+00:00 2026-05-25T22:30:48+00:00

I would like to display the information about user’s registration state. It should be

  • 0

I would like to display the information about user’s registration state. It should be displayed on every view, but i consider, that writting this code for about 20 times is a bad idea. By the way, this is the code, it works, i guarantee that:

View/RegistrationInfo:

<table width="95%" border="0" cols="2">
  <tr>
    <td width="50%" height="124"><h2><strong>Simple Blog </strong></h2></td>
    <td width="50%" height="124">

    @if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
    {
        using (Html.BeginForm("LogOff", "Account"))
        {
        <table width="95%" height="86" border="0">
                    <tr>
                        <td width="50%" valign="middle">Hello, @System.Web.HttpContext.Current.User.Identity.Name</td>
                        <td width="50%" valign="middle" align = "right"><input type="submit" value="Exit" /></td>
                    </tr>
        </table>
        }
    }
    else
    {
            using (Html.BeginForm("LogIn", "Home"))
            {
                <table width="95%" height="86" border="0">
                    <tr>
                        <td width="45%" valign="bottom">Login:</td>
                        <td width="45%" valign="bottom">Password:</td>
                        <td width="10%"></td>
                    </tr>
                    <tr>
                        <td width="45%">
                            <p>
                                <input type="text" name="login" />
                            </p>
                        </td>
                        <td width="45%">
                            <p>
                                <input type="password" name="password" />
                            </p>
                        </td>
                        <td width="10%" align="left"> 
                            <input type="submit" value="Enter" />
                        </td>
                    </tr>
                    <tr>
                        <td width="45%" valign="top">
                            @Html.ActionLink("Register", "Register", "Account")
                        </td>
                    </tr>
                </table>
            }

        }

     </td>
  </tr>
</table>

<hr align="left" width="100%" size="2" />

As you can see, this view doesn’t require to be strongly typed… and i don’t know, should I modify any controllers (because, all information is stored in HTML Context), and how. I tried to call

@Html.RenderAction("RegistrationInfo", "Home");

or
@Html.RenderPartial(“RegistrationInfo”, “Home”);

and every time i receive compile error with message about invalid parametres

  • 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-25T22:30:49+00:00Added an answer on May 25, 2026 at 10:30 pm

    The following should work:

    @Html.Partial("~/Views/Home/RegistrationInfo.cshtml")
    

    Or if you are inside a view of the Home controller simply:

    @Html.Partial("RegistrationInfo")
    

    Or if you put this partial in ~/Views/Shared/RegistrationInfo.cshtml you will be able to reference with the shorthand syntax.

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

Sidebar

Related Questions

If I have a foo resource and I would like to display information about
I would like to do something like this : def main(): Display Information about
I would like to display details of an xml error log to a user
I would like to display some smiley's inbetween text in my chatbox but when
I need to display additional information, like a tooltip, but it's a lot of
I would like display something more meaningful that animated gif while users upload file
I would like to display some memory statistics (working set, GCs etc.) on a
I would like to display multiple colors (and potentially shapes and sizes) of data
I would like to display the up time of the machine my code is
I would like to display the differences between versions of the same content. Initially

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.