Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSet Binding during Postback causing issues with Logout

Status
Not open for further replies.

jmikow

Programmer
Mar 27, 2003
114
US
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 :

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top