Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
14
Reply
How to add days to date automatically when select new date
Abdalla Elawad
Apr 21 2016 3:36 AM
575
Reply
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 date in textbox1= 30/01/2016 label1 display color is Red
if date in textbox1= 01/01/2016 label1 display color Green
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
if date in textbox1= 35/01/2016 label1 display color is Red
if date in textbox1= 01/01/2016 label1 display color Green
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());
}
}
}
please help me
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
14
)
Next Recommended Forum
Convert code have got Control to code .Net 2.0
How to get the position or line throwing exception