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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top