leearach2004
Technical User
Hi there I have a collection of mobile form within on aspx file. I am having problems with the postback feature for a listbox.
I had a mobile form as my main page when i satrted designing and it worked fine but now i have added a new main form and had the origonal as a sub form it no longer works, heres the code
this should check if the list is loaded for the first time, if it is populate it from the sql database else display the data object with the information relevent to that selected from the dropdown list. This worled when it was the first page to load but now the form is activated from a main page.
This for some reason now populates the list and tries to display the information at the same time it like it is checking for not ispostback and running the command but then checking for postback and running that to
anyone have any ideas I hope so cause im stumped
lee
I had a mobile form as my main page when i satrted designing and it worked fine but now i have added a new main form and had the origonal as a sub form it no longer works, heres the code
Code:
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
this should check if the list is loaded for the first time, if it is populate it from the sql database else display the data object with the information relevent to that selected from the dropdown list. This worled when it was the first page to load but now the form is activated from a main page.
This for some reason now populates the list and tries to display the information at the same time it like it is checking for not ispostback and running the command but then checking for postback and running that to
anyone have any ideas I hope so cause im stumped
lee