Setting defaults on FormView insert

D

David C

I have a FormView that I want to set some defaults in some of the TextBox
and DropDown controls. I have tried code below but it is not working. I was
assuming that I could do this in the ModeChanged event of the FormView. Any
help is appreciated.
-David

Protected Sub fvTask_ModeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles fvTask.ModeChanged
If fvTask.CurrentMode = FormViewMode.Insert Then
Dim tx As TextBox = fvTask.FindControl("txtTaskDate")
tx.Text = DateTime.Today.ToShortDateString
End If
End Sub
 
D

David C

Please ignore. I set them in the Page_Load and checking the CurrentMode
there.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top