0
我想將輸入的文本框的值傳遞給jquery中的變量。取Html.TextBox的值
@Html.TextBox("username", @Views.Resource.EnterEmail, new { @class = "cssclass" })
jQuery的
$(document).ready(function() {
$("#Login").click(function() {
var u = ??;
var p = ??;
$.ajax({
type: "POST",
url: "/User/Login",
data: "username=" + u + "&password=" + p
});
});
});
像$('#username')。text? – njzk2 2011-12-14 10:53:22