Click here to Skip to main content
15,912,493 members

Comments by Yılmaz Korkmaz (Top 1 by date)

Yılmaz Korkmaz 27-Aug-12 11:03am View    
I want to filter a field in the database table.
Value of the function can not send.

@using (Html.BeginForm())
{
Html.EnableUnobtrusiveJavaScript(true);
@Html.ValidationSummary(true)
<fieldset>
<div class="editor-label">
@Html.LabelFor(model => model.sender_name)
</div>
<div class="editor-field">
@Html.TextBox("sendername", null, new { onkeyup = "GetSenderName(this.value);" })

@Html.Hidden("sender_name")
@Html.ValidationMessageFor(model => model.sender_name)
</div>
<p>
<input type="submit" value="Submit" />
</p>
</fieldset>
}
<script type="text/javascript">
function GetSenderName(value) {
$.ajax({
type: "GET",
url: "/RCV/GetSenderName",
data: "{id:" + value + "}",
contentType: "application/json; charset=utf-8",
success: function (msg) {
$("#senderContent").html(msg.toString);
},
error: function () {
alert("not connected!");
}
});
}
</script>