Я использую asp.net mvc2.
Код Javascript:
$(document).ready(function () {
$("#candidatecontact").hide();
document.getElementById("counting").value = '<%=ViewData["ResumesCount"] %>';
$('#butt2').click(function ()
{
count();
});
});
function count() {
var tempId = <%=Model.Id%>;
var url = '/Page/Count';
$.ajax({
type: "GET",
url: url,
data: { id : tempId},
dataType: "int",
success : function (count) {
SetCount(count);
}
});
}
Код HTML:
<% ViewData["ResumesCount"] = remainingHorsCount; %>
<input id = "counting" type = "text" style="width:20px;"/>
когда загрузка страницы в приведенном выше текстовом поле показывает значение ViewData["ResumesCount"]
.. Пожалуйста, дайте мне идеи для этого?
Пытаться
<input id = "counting" type = "text" value="<%= remainingHorsCount%>" style="width:20px;"/>
или
<input id = "counting" type = "text" value="<%= ViewData['ResumesCount']%>" style="width:20px;"/>
<%...%>
здесь.