[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • 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
 
newbiewebAuthor Commented:
Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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