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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:51:14+00:00 2026-05-27T18:51:14+00:00

Typically I’m ok with the auto-generated form element names when using the HTML helper

  • 0

Typically I’m ok with the auto-generated form element names when using the HTML helper like this:

@Html.TextBoxFor(m => m.Property)

Unfortunately, I have a requirement to create an input with a specific name attribute.

I realize I can just build the input using normal HTML and use a model binder or a BindAttribute to retrieve its submitted value. However, I wanted to see if there was a way for me to attribute a property instead to specify both the generated input name and enable the binding.

Is this possible? If so, how can it be done?

  • 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-27T18:51:15+00:00Added an answer on May 27, 2026 at 6:51 pm

    Description

    One way to set the name of the input element is to use a overload of TextBoxFor.
    But this would result in problems with the default model binder. You can create your own ModelBinder to solve this issue.

    Sample

    @Html.TextBoxFor(m => m.Property, new { @name = "YourName" })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I typically have code like this on a form: private void PerformLongRunningOperation() { BackgroundWorker
typically definition of property/column looks like this: <property name=DocumentSummary column=DocumentSummary length=100 type=String> <column name=DocumentSummary
Typically you will find STL code like this: for (SomeClass::SomeContainer::iterator Iter = m_SomeMemberContainerVar.begin(); Iter
typically the code is something like: <html> <head> <style type=text/css> body { font-size:12pt; font-family:
typically when you refer to an object you would use a selector like this
Typically I have to write layout code like this: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical
I typically write something like this: class Person < ActiveRecord::Base attr_accessible :first_name, :last_name def
Typically, I would call another class method like this: MyClass *class = [[MyClass alloc]
Typically when creating an action from something like a button you have this [button
I typically refer to any assets on my site using absolute path so that

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.