Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <input name="ActivateBtn" type="submit" class="btn btn-primary" value="Activate" onclick="opendatedialog()" />
  2.  
  3. <script>
  4. function opendatedialog() {
  5. $("#datepickerdialog").dialog({
  6. height: 300,
  7. width: 500,
  8. modal: true,
  9. resizable: false,
  10. buttons: {
  11. "OK": function () {
  12. var viewUrl = '@Url.Action("Activate", "User")';
  13. $.post(viewUrl, new { startDate: $('.datepickerstart').val(), endDate: $('.datepickerend').val() });
  14. $(this).dialog("close");
  15. return true;
  16. },
  17. "Cancel": function () { $(this).dialog("close"); return false; }
  18. },
  19. open: function () {
  20. $(this).siblings('.ui-dialog-buttonpane').find("button:contains('OK')").focus();
  21. }
  22. });
  23. }
  24. $(function () {
  25. $('.datepickerstart').datepicker(
  26. {
  27. minDate: 0,
  28. dateFormat: 'yy-mm-dd'
  29. }).datepicker("setDate", "0");
  30. $('.datepickerend').datepicker(
  31. {
  32. minDate: 0,
  33. dateFormat: 'yy-mm-dd'
  34. }).datepicker("setDate", "2099/12/31");
  35. });
  36.  
  37. [HttpPost]
  38. public ActionResult Activate(DateTime startDate, DateTime endDate)
  39. {
  40. //TO DO
  41. return RedirectToAction("Index");
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement