• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

Need to set the value for TextBoxFor()

I am making a Helper function that reads the values from a database, so I need to programmatically set the value used by TextBoxFor. I have the Lambda Expression to query and even set explicitly.

How do I set the Lambda expression to contain a new value for that property?

OR

How do I passs that new value (from the db) into Html.TextBoxFor()?

Thanks.
0
newbieweb
Asked:
newbieweb
1 Solution
 
Kumaraswamy RCommented:
instead you have to pass it to your view using TempData[""] or ViewData[""]

ex
http://stackoverflow.com/questions/7337520/prepopulate-html-textboxfor-in-asp-net-mvc-3
0
 
newbiewebSr. Software EngineerAuthor Commented:
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now