1

Name:

<%= Html.TextBox("txtName", "20", new { @class = "hello" }) %>

I want that in VB.NET , is it .cssclass="hello" or is it something else?

2
  • It should just be how you've set it there. Commented Aug 27, 2009 at 8:22
  • u mean .cssclass="hello" ?? but its not working Commented Aug 27, 2009 at 9:02

2 Answers 2

4

This works:

<%=Html.TextBox("TextName", "TextBox value", New With {.class = "theClass"})%>
Sign up to request clarification or add additional context in comments.

Comments

1

You need to use the "With" keyword, and a dot, as follows:

1 Comment

doh! beat by 45 seconds? /sigh

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.