This is the code of my two Textbox:
Textbox 1:
- <asp:TextBox ID="txtDate1" runat="server" ReadOnly = "true"></asp:TextBox>
Textbox 2:
- <asp:TextBox ID="txtDate2" runat="server" ReadOnly = "true"></asp:TextBox>
This is the code of my JQUERY:
- <script>
- $(function () {
- $("[id*=txtDate1]").datepicker({
- showOn: "button",
- buttonImage: "images/calendario.png",
- buttonImageOnly: true,
- buttonText: "a",
- minDate: 0,
- maxDate: 2,
- dateFormat: 'dd-mm-yy' }); });
- </script>
-
- <script>
- $(function () {
- $("[id*=txtDate2]").datepicker({
- showOn: "button",
- buttonImage: "images/calendario.png",
- buttonImageOnly: true,
- buttonText: "a",
- minDate: 2,
- dateFormat: 'dd-mm-yy' }); });
- </script>
This is the code i was writing..on C# Asp.net
- DateTime fechaUno = Convert.ToDateTime(txtDate1.Text);
- DateTime fechaDos = Convert.ToDateTime(txtDate2.Text);
- TimeSpan difFechas = fechaDos.Subtract(fechaUno);
I want to print the result in days in a variable