How to add date automatically when select new date ??
I have Dropdown list contains 2 items (ATM,CIT) ,textbox1 is (date) and textbox2 is also (date)
if select date in textbox1 in text_change you must display date in textboxt2 automatically +30days if selected item from droplist is = ATM
for example if i selected date in textbox1 is (01/01/2016) should display date automatically in textbox2 (30/01/2016)
if date in textbox1= 26/01/2016 label1 display color is yellow
if select date in textbox1 in text_change you must display date in textboxt2 automatically +35days if selected item from droplist1 is = CIT
for example if i selected date in textbox1 is (01/01/2016) should display date automatically in textbox2 (30/01/2016)
if date in textbox1= 30/01/2016 label1 display color is yellow
protected void TextBox5_TextChanged(object sender, EventArgs e)
{
// How to add days to current date in date in other text
TextBox6.Text = TextBox5.Text;
DateTime dt = DateTime.Now.AddDays(30);
dt.AddDays(-1).ToString("dd/MM/yyyy");
TextBox6.Text = dt.ToShortDateString();
Label1.Text = ("Team Should Be Changed In:" + dt.AddDays(0).ToShortDateString());
}
}
}
{
// How to add days to current date in date in other text
TextBox6.Text = TextBox5.Text;
DateTime dt = DateTime.Now.AddDays(30);
dt.AddDays(-1).ToString("dd/MM/yyyy");
TextBox6.Text = dt.ToShortDateString();
Label1.Text = ("Team Should Be Changed In:" + dt.AddDays(0).ToShortDateString());
}
}
}
please help me


Manas MohapatraRank #182 · 13.2K reputationPosted Apr 21, 2016, 1:24 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 21, 2016, 1:39 AM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Apr 21, 2016, 1:49 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 21, 2016, 2:08 AM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Apr 21, 2016, 2:22 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 21, 2016, 2:40 AM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Apr 21, 2016, 2:42 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 21, 2016, 2:47 AM EDT
Imtiyaz AnsariRank #1,031 · 1.9K reputationPosted Apr 21, 2016, 5:33 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 21, 2016, 5:55 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 21, 2016, 5:57 AM EDT
theLizardRank #1,079 · 1.8K reputationPosted Apr 21, 2016, 1:00 PM EDT
textBox2.Text = (date2 = date1).AddDays(30).ToString("dd/MM/yyyy");
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex == 1)
{
date1 = DateTime.Now;
textBox1.Text = date1.ToString("dd/MM/yyyy");
}
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 24, 2016, 10:48 PM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Apr 24, 2016, 11:01 PM EDT