Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
i want to add default value to the html text box by the view data. the foolwing code will give an idea wht i want to do exactly
but it shows an error. plz tel me the solution for this. thank in advance....
You want to do this instead:
Html.TextBox("quantity", Html.Encode(ViewData["quantity"]), new { maxlength = 4 })
Note: I removed the scriptlet tags around your Html.Encode. Once you're inside scriptlet tags, you don't need to use them again.
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.