Avatar of skolanti
skolanti asked on

Adding date automatically to textbox when i select an item from drop down list

I have a drop down list which has 3 items in it, i also have two Textboxes, Textbox1 and Textbox2. I want that when I select item1 from Dropdownlist and enter a date in Textbox1, The date in Textbox2 should be changed to 3years ahead of the date in Textbox1. Similarly when i select Item2 in dropdownlist and enter a date in Textbox1 the date in textbox2 should be automatically changed to (Textbox1 date+5years). I have the date in MM/DD/YYY format. Any ideas how to achive it using C# code. I know that I can use a stored procedure for this but I want to accomplish this using C# code.
C#Web Development Software

Avatar of undefined
Last Comment

8/22/2022 - Mon


Hi, I am a beginner in ASP.Net web development, Can you provide me with sample code according to my Scenario?

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Thanks, This code worked but I had to make some changes based on my program.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

Thanks, this code worked fine but I had to make some changes based on my Program logic.

B is a bit unfriendly, I gave you the entire code needed to do what you needed... but thanks anyway