|
-
Dec 27th, 2006, 11:08 AM
#1
Thread Starter
Member
[RESOLVED] IsPostBack Running Twice
Hi there I am using
if not IsPostBack then
to check if a list box is loaded for the first time
this worked fine when the page was the main form
Protected Sub frmloc_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles frmloc.Load
Dim locations As New tbllocAdapter
Dim allStock As New tbl_StockTableAdapter
If Not IsPostBack Then
sltLoc.DataSource = locations.faetlocdata
sltLoc.DataValueField = "Location"
sltLoc.DataTextField = "Location"
sltLoc.DataBind()
Else
oblstRec.DataSource = allStock.getstock(sltLoc.Selection.Value)
oblstRec.DataBind()
End If
End Sub
but now i have a main screen that selects this form from a drop down list(search criteria)
by dowing this it now trys to run the else statment when the page is first loaded which of course from the code is trying to load an object list that has been created yet as the list is poulated when an option from the dropdown is selected.
Like I said this worked whne the page was the main form but now it is not it seems to ignore the not IsPostBack and go to the else straigth away
anyone have any ideas
lee
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|