Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with variable
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01152158
Message ID:
01153097
Views:
28
Okay, I'm a bit confused (which isn't the first time). You posted this code:
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 Sub
Then, 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 you want it on initial page load only:
If Not Page.IsPostBack Then
    ' Do something
    AddNewRecord()
End If
If 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 If
And if that's not it, then maybe you could post some of the code that sets the value of your problem property.

HTH,
Chad


>Hi Chad, I have tried Protected as well, stil the same. Just found out that the Page.IsPostBack is causing the problem, if I remove this, it is working fine. Anyway, I still need the Page.IsPostBack to perform the addRecord function, any idea?
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform