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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:38:08+00:00 2026-05-13T10:38:08+00:00

I read ScottGu’s explanation on Strongly Typed Html Helpers and I understand that it

  • 0

I read ScottGu’s explanation on Strongly Typed Html Helpers and I understand that it gives me the ability to do better compile time checking of views. I was under the impression that I already had this when I used the model.PropertyName in the MVC1 Html.TextBox helper, but apparently that is not true. So, how does using a lambda expression do this better for me?

  • 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-13T10:38:08+00:00Added an answer on May 13, 2026 at 10:38 am

    Consider the syntax of the existing HTML helper methods:

    <%= Html.TextBox("Quantity", Model.Quantity) %>
    

    If you rename the Quantity property on your object to “CurrentQuantity”, the generated <input> element will still have name="Quantity" specified, and model binding will break if you don’t remember to change that first parameter.

    By using a lambda expression to specify the name of the element, an incorrect or misspelled property name becomes a compilation error.

    <!-- No magic strings here! -->
    <%= Html.TextBoxFor(model => model.CurrentQuantity) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read at Scottgu blog about using OutputCache for a function but this didn't
Read Carefully The question here is not that does PHP parser processes comments or
I read that the AppError class is now for backwards compatibility and that Exceptions
I read through a few pages but cannot understand how email sending works. What
I read somewhere that I should stop using <%= … %> to render and
I'm sure I read on Scott Gu's blog (or somewhere equally authoritative) that .net
Read that the following code is an example of unsafe construction as it allows
I read ScottGu's blog entry ( http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx ) a while back, and it seems
I read that int c; while(c = getchar() != EOF) { putchar(c); } will
I have read this article http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx about auto-start mode in asp.net4.0 and still don't

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.