@Html.Label("Start", "Start Date:") @Html.TextBox("Start", string.Empty, new {@id = "Start", @class = "datepicker"}) @Html.Label("endd", "End Date:") @Html.TextBox("endd", string.Empty, new {@id = "End", @class = "datepicker"}) <input type="submit" value="Apply" id ="DateSelected" /> <script type="text/javascript"> $('.datepicker').datepicker(); $("#DateSelected").click(function () { var startD = $('#Start').val().toString(); var endD = $('#End').val().toString(); $.ajax({ url: '/Docs/FirstDoc', type: "Post", data: { start: String.valueOf(startD), end: String.valueOf(endD) }, }); </script>
[HttpPost] public ActionResult FirstDoc(string start, string end) { FirstDocModel firstDocModel = FirstDocHelper.RunFunction(start, end); return PartialView(firstDocModel); }
String
String.valueOf
data: { start: startD, end: endD }
String.valueOf()
startD
endD
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)