0

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

, new { maxlength = 4 })%>

but it shows an error. plz tel me the solution for this. thank in advance....

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.