Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then 'Do something Else AddNewRecord() End If End SubThen, in the message below you state that you need the IsPostBack to perform the addRecord. Are you wanting AddNewRecord() to be called on every page load or only on postbacks or only on initial page loads (not postbacks)?
If Not Page.IsPostBack Then ' Do something AddNewRecord() End IfIf you want it on all page loads (including postbacks):
If Not Page.IsPostBack Then ' Do something End If AddNewRecord()Or, if you just want it on postbacks (not initial page load):
' Do something If Page.IsPostBack Then AddNewRecord() End IfAnd if that's not it, then maybe you could post some of the code that sets the value of your problem property.