learning
learning

Reputation: 11735

How to use Encode with html textbox

I want to use the Html.Encode by replacing Name <%=Html.TextBox("Name", Model.projectModel.Name)%>

However, since i`m using jquery, How I can still keep the name of the texbox?

Is it possible to use Html.encode and still keep the name of the textbox?

Upvotes: 1

Views: 908

Answers (1)

Alxandr
Alxandr

Reputation: 12431

I think you're looking for this:

<%= Html.TextBox("Name", Html.Encode(Model.projectModel.Name)) %>

Upvotes: 2

Related Questions