Link to home
Avatar of rwallacej
rwallacej

asked on

ASP.net form - set default value of field to be current date

Hi

I've got a FormView control which has an InsertItemTemplate. On this template there's a textbox DateTextBox that I'd like the default value be todays date in format dd/mm/yyyy. How is this set?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of strickdd
strickdd
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of rwallacej
rwallacej

ASKER

thanks, here's what it was

    Protected Sub FormView1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.Load
        CType(FormView1.FindControl("DateTextBox"), TextBox).Text = DateTime.Now.ToShortDateString()
    End Sub