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 7854461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:04:09+00:00 2026-06-02T20:04:09+00:00

In my _layout.cshtml i want to add a menu like that: @Html.ActionLink(Profile, Details, User,

  • 0

In my _layout.cshtml i want to add a menu like that:

  • @Html.ActionLink("Profile", "Details", "User", new {e_id ="myemail@email.com")
  • i want to pass

    @Context.User.Identity.Name

    as e_id. Can i pass it in that way?? if not then what is the other way?When I hard coded like that:

  • @Html.ActionLink("Profile", "Details", "User", new { e_id="awladliton@gmail.com"})
  • it don’t redirect me in the User controller Details action.when i give URL like that:

    http://localhost:48096/User/Details?e_id=awladliton@gmail.com

    It Works Fine. Thanks in advance

    • 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-06-02T20:04:11+00:00Added an answer on June 2, 2026 at 8:04 pm

      Use like this

      @Html.ActionLink("Profile", "Details", "User", new { e_id="Context.User.Identity.Name},null)
      

      It uses this overload

      public static MvcHtmlString ActionLink(
          this HtmlHelper htmlHelper,
          string linkText,
          string actionName,
          string controllerName,
          Object routeValues,
          Object htmlAttributes
      )
      

      If you want to pass any custom HTML attributes to the link element, you can replace the fifth parameter with that

      Ex :

       @Html.ActionLink("Profile", "Details", "User", new { e_id="yourvalue"},new {@class="myCSsClassName"})
      
      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    I have this menu in _Layout.cshtml : <td class=MenuStructure> <ul id=menu> <li>@Html.ActionLink(First Page, Page1Action,
    I have a top-level _Layout.cshtml that looks something like this: <html> <head> @RenderSection(Header, required:
    I want to render a view when user clicks on Add New button on
    I've got a common Layout.cshtml file that I want to share. When I add
    I have something like @{ Html.RenderPartial(@~/Views/Management/_Main.cshtml); } Can I change this view without page
    I have an Index.cshtml view: @model AttendenceModel @{ Layout = ~/Views/Shared/_Layout.cshtml; } @using (Html.BeginForm(VisOppsummering,
    When mvc3 was created I placed one of these on my _layout.cshtml page... @Html.RenderCss()
    How do you create a seperate _layout.cshtml for a HomePage design that is not
    I have section for scripts in my _Layout.cshtml: <html> <body> ... @RenderSection(FooterScript, required: false)
    Hi I would like to dynamically load meny items in the _Layout.cshtml file. How

    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.