I'm fairly new to ASP.Net and am still learning the ropes.
I have a DataList that is populated by a DataSet with results when doing searches on a web page.
In the Page_OnLoad subroutine I have :
The GetResults() call is so that when an item is selected it will rebind the DataSet and still show the DataList to the user. I found I had to do a bind each time, or the list would simply disappear.
Now I'm trying to implement a Logout button in a header.ascx that I am using. When I am on the search page and I click "Logout" it gets an error in the GetResults() routine, which I don't want it to execute.
This may be a little confusing, but I am trying to get a grasp on if I am doing it the right way, or if I need to change the way I do things to get my Logout button to work.
Any suggestions would be greatly appreciated.
I have a DataList that is populated by a DataSet with results when doing searches on a web page.
In the Page_OnLoad subroutine I have :
Code:
If Not Page.IsPostBack Then
PopulateContacts() 'Only populate the contacts list when the page loads for the first time
Else
GetResults() 'Re-bind the search results to keep it viewable between postbacks
End If
The GetResults() call is so that when an item is selected it will rebind the DataSet and still show the DataList to the user. I found I had to do a bind each time, or the list would simply disappear.
Now I'm trying to implement a Logout button in a header.ascx that I am using. When I am on the search page and I click "Logout" it gets an error in the GetResults() routine, which I don't want it to execute.
This may be a little confusing, but I am trying to get a grasp on if I am doing it the right way, or if I need to change the way I do things to get my Logout button to work.
Any suggestions would be greatly appreciated.