code part-
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btncreat_Click(object sender, EventArgs e)
{
int Totaldays = duration(txtstart.Text, txtEnd.Text);
diffrence.Text = Convert.ToString(Totaldays);
}
public int duration(string startdate, string enddate)
{
DateTime dt1 = DateTime.Parse(Convert.ToDateTime(txtstart.Text).ToString("MM/dd/yyyy"));
DateTime dt2 = DateTime.Parse(Convert.ToDateTime(txtEnd.Text).ToString("MM/dd/yyyy"));
TimeSpan ts = dt2.Subtract(dt1);
int days = ts.Days;
return days;
if (txtEnd.Text == System.DateTime)
{
}
}
}
design part
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Upload Image: | |||
Enter Image Desc | |||
Text="Submit" /> |
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Apr 9, 2013, 6:29 AM