Set mode in FormView on Page_Load

S

staeri

I'm trying to set the FormView in insert mode but nothing happens with
this code:

Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
FormView1.ChangeMode(FormViewMode.Insert)
End Sub

If I click the New button on the form everything works but not with
code.

Can someone please help me?

Regards,

S
 
Z

zzzxtreme

try

Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) handles Me.Load
 
C

Christopher Reed

Try this inside your Page_Load:

If (Not IsPostBack) Then
FormView1.DefaultMode = FormViewMode.Insert
End If

Then again, I'm not sure if you're showing enough code.
 

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,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top