duplicate record insertion on postback

Sep 28, 2009 at 10:22 AM

I use VB.net

aspx.vb

Protected Sub btnSaveClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveClose.Click
        SaveData()
        ExtAspNet.Alert.Show("Save Complete.", String.Empty, ExtAspNet.ActiveWindow.GetClosePostBackReference())
    End Sub

   Private Sub SaveData()
        Dim mm As New MoneyType
        mm.MoneyTypeName = tbxName.Text
        mm.CreateDate = Now()
        MoneyType.Insert(mm)
    End Sub

When i click btnSaveClose Insert data to database it duplicate record.

Please help me.

Coordinator
Oct 19, 2009 at 3:12 AM

I didn't see any problem in your code. Maybe you should check the Window1_Close event function in the parent window.