I feel like I am looking for the wrong thing...and probably am.
I have some code in my app to allow the user to input the inspection date.
All I am wanting to do is insert a default value of todays date. It can be overwritten by the user if need as it is not critical. I keep thinking I should be able to do this in the view with some form of default for the input but...
I have some code in my app to allow the user to input the inspection date.
C#:
[COLOR=blue][FONT=Consolas]<[/FONT][/COLOR][COLOR=maroon][FONT=Consolas]div[/FONT][/COLOR][COLOR=black][FONT=Consolas] [/FONT][/COLOR][COLOR=red][FONT=Consolas]class[/FONT][/COLOR][COLOR=blue][FONT=Consolas]=[/FONT][/COLOR][COLOR=blue][FONT=Consolas]"form-group"[/FONT][/COLOR][COLOR=blue][FONT=Consolas]>[/FONT][/COLOR] [COLOR=blue]<[/COLOR][COLOR=purple][B]label[/B][/COLOR] [COLOR=purple][B]asp-for[/B][/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"[/COLOR]InspectDate[COLOR=blue]"[/COLOR] [COLOR=red]class[/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"col-md-2 control-label"[/COLOR][COLOR=blue]></[/COLOR][COLOR=purple][B]label[/B][/COLOR][COLOR=blue]>[/COLOR]
[COLOR=blue]<[/COLOR][COLOR=maroon]div[/COLOR] [COLOR=red]class[/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"col-md-10"[/COLOR][COLOR=blue]>[/COLOR]
[COLOR=blue]<[/COLOR][COLOR=purple][B]input[/B][/COLOR] [COLOR=purple][B]asp-for[/B][/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"[/COLOR]InspectDate[COLOR=blue]"[/COLOR] [COLOR=red]class[/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"form-control"[/COLOR] [COLOR=purple][B]value[/B][/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"[/COLOR]@[COLOR=#2b91af]DateTime[/COLOR].Today[COLOR=blue]"[/COLOR][COLOR=blue]/>[/COLOR]
[COLOR=blue]<[/COLOR][COLOR=purple][B]span[/B][/COLOR] [COLOR=purple][B]asp-validation-for[/B][/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"[/COLOR]InspectDate[COLOR=blue]"[/COLOR] [COLOR=red]class[/COLOR][COLOR=blue]=[/COLOR][COLOR=blue]"text-danger"[/COLOR] [COLOR=blue]/>[/COLOR]
[COLOR=blue]</[/COLOR][COLOR=maroon]div[/COLOR][COLOR=blue]>[/COLOR] [COLOR=black][FONT=Consolas] [/FONT][/COLOR][COLOR=blue][FONT=Consolas]</[/FONT][/COLOR][COLOR=maroon][FONT=Consolas]div[/FONT][/COLOR][COLOR=blue][FONT=Consolas]>[/FONT][/COLOR]
All I am wanting to do is insert a default value of todays date. It can be overwritten by the user if need as it is not critical. I keep thinking I should be able to do this in the view with some form of default for the input but...