Vivek Kumar Vishwas

Vivek Kumar Vishwas

  • NA
  • 115
  • 56.4k

How to print all date between two Different Dates in Asp.net

Nov 8 2017 2:05 AM
Hello
 
My Requirment is as following
 
Printing all the dates between first date & Second date
 
.aspx--------------
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="date-picker.aspx.cs" Inherits="date_picker" %>  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head runat="server">  
  5. <title>jQuery UI Datepicker - Change Date Format Example</title>  
  6. <link href="css/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />  
  7. <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>  
  8. <script src="js/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script>  
  9. <script type="text/javascript">  
  10. $(function () {  
  11. $("#txtDate").datepicker({ dateFormat: 'yy-mm-dd' });  
  12. });  
  13. </script>  
  14. <script type="text/javascript">  
  15. $(function () {  
  16. $("#txtDate2").datepicker({ dateFormat: 'yy-mm-dd' });  
  17. });  
  18. </script>  
  19. <style type="text/css">  
  20. .ui-datepicker  
  21. {  
  22. font-size: 8pt !important;  
  23. }  
  24. </style>  
  25. </head>  
  26. <body>  
  27. <form id="form1" runat="server">  
  28. <div class="demo">  
  29. <b>Date 1:</b>  
  30. <asp:TextBox ID="txtDate" runat="server" />  
  31. <br /><br />  
  32. <b>Date 2:</b>  
  33. <asp:TextBox ID="txtDate2" runat="server" />  
  34. <br />  
  35. <br />  
  36. <asp:Button ID="printdate" runat="server" Text="Print Dates"  
  37. onclick="printdate_Click" />  
  38. </div>  
  39. </form>  
  40. </body>  
  41. </html>  
. cs-------------------------
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Web;  
  5. using System.Web.UI;  
  6. using System.Web.UI.WebControls;  
  7. public partial class date_picker : System.Web.UI.Page  
  8. {  
  9. protected void Page_Load(object sender, EventArgs e)  
  10. {  
  11. }  
  12. protected void printdate_Click(object sender, EventArgs e)  
  13. {  
  14. }  
  15. }

Attachment: date-print.rar

Answers (3)