3

I've seen the other posts referencing C# syntax do do this, but I can't find how to do it using VB.NET. I swear I'm daft. I keep trying different variations that I think would work but I'm missing it.

C# Syntax is:

Html.TextBox("title", Model.Title, new { @class = "txt" }) 

How do I do that in VB?

Thanks!

1 Answer 1

5

Try:

New With {.class = "txt" }
Sign up to request clarification or add additional context in comments.

2 Comments

Close enough for me. Thanks so much! Actual code that worked was just had to drop the @ New With {.class = "txt" }
Cheers -- I know in C# I have to escape the class keyword, but I wasn't sure in VB.Net.

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.