Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input name="ActivateBtn" type="submit" class="btn btn-primary" value="Activate" onclick="opendatedialog()" />
- <script>
- function opendatedialog() {
- $("#datepickerdialog").dialog({
- height: 300,
- width: 500,
- modal: true,
- resizable: false,
- buttons: {
- "OK": function () {
- var viewUrl = '@Url.Action("Activate", "User")';
- $.post(viewUrl, new { startDate: $('.datepickerstart').val(), endDate: $('.datepickerend').val() });
- $(this).dialog("close");
- return true;
- },
- "Cancel": function () { $(this).dialog("close"); return false; }
- },
- open: function () {
- $(this).siblings('.ui-dialog-buttonpane').find("button:contains('OK')").focus();
- }
- });
- }
- $(function () {
- $('.datepickerstart').datepicker(
- {
- minDate: 0,
- dateFormat: 'yy-mm-dd'
- }).datepicker("setDate", "0");
- $('.datepickerend').datepicker(
- {
- minDate: 0,
- dateFormat: 'yy-mm-dd'
- }).datepicker("setDate", "2099/12/31");
- });
- [HttpPost]
- public ActionResult Activate(DateTime startDate, DateTime endDate)
- {
- //TO DO
- return RedirectToAction("Index");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement