Hi
I have a peculiar situation at hand in which I need to validate a pair of dates in an ASP.Net web app.This is how my page looks like :
I have a "From Date" field which consists a set of three dropdownlists ( for Year , Month and Date) I have a "To Date" field which also consists a set of three dropdownlists ( for Year , Month and Date). There is a "Download Report" button on the screen ( which allows a user to download a report for the specified date range)
All these six dropdownlists are wrapped in a user control.
Now all the 6 dropdownlists have a default "please select" value. When a user lands on the page for the first time , all dropdownlists are set to "please select". The "Download" button is enabled only after valid 'From' and 'To' dates are selected.
Now my requirement is that :
When a user lands on the page for the first time , no attempt to validate the dates should be made until he selects all the 6 dropdownlists at least once.
When the 6th dropdownlist is selected , the From and To dates should be validated. Once a user has selected all 6 dropdowns once , subsequently on every dropdownlist postback , the dates should be validated.
My Issue:
What's the best way to track these 6 distinct postbacks ( for each of the dropdowns) before starting to validate the From and To Dates. I could maintain a flagin ViewState .. but is there a better way ?
Thanks in advance !