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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:49:52+00:00 2026-05-12T05:49:52+00:00

I am playing around with the ASP.NET MVC Html.Helpers and I noticed that say

  • 0

I am playing around with the ASP.NET MVC Html.Helpers and I noticed that say for instance:

Html.Textbox("test");  

will render the name attribute to "name=test" and the id tag will be "id=test"

But when I do this:

<%= Html.TextBox("go", null, new { @name = "test2", @id = "test2", @class = "test2" })%>

id will be "id=test2" but name will be "name=go"

Why does it not get overridden?

I also don’t really still understand what the name tag actually does. I don’t think I ever even used.

P.S

I am aware that “name” and “id” probably don’t need to be escaped only “class” does since it is a keyword but I just do it for all of them just so I don’t forget to do it or have to even remember if something is a keyword or not.

  • 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-12T05:49:52+00:00Added an answer on May 12, 2026 at 5:49 am

    The name attribute is used when accessing that form element’s value on the server side. Like so :

    string val = Request.Name["go"];
    

    As for specifying the name attribute, well that’s what the first parameter of the Html.TextBox method is there for.

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

Sidebar

Related Questions

I've been playing around with ASP.NET MVC 4 beta and I noticed two controllers:
I'm playing around with ASP.NET MVC and I just loaded up an empty project
I'm playing around with some Dependency Injection ( StructureMap ) with my ASP.NET MVC
I'm just getting started with ASP.NET MVC 2, and playing around with Validation. Let's
I'm playing around with a composite control that uses the ASP.NET templating system. I
I am playing around with AJAX functionality using ASP.NET MVC. I have created a
I am playing around with FluentSecurity library for asp.net mvc. One of the interfaces
I've been playing around with ASP.NET MVC 4 beta and I see two types
i downloaded asp.net mvc and i am playing around with the main tutorial. In
I'm currently playing around with ASP .NET MVC 3 and - for data access

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.