Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
value from @html.TextBoxfor(x=>x.Name) in a varilable using Jquery
Posted

1 solution

Try this:

@Html.TextBoxFor(x => x.Name, new { Id="txtName" })

In your Script part, try with this:

$("#txtName").change(function () {
var name = $("#txtName").val();
alert(name);
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900