What's Happening When I Click Refresh?

Discussion in 'ASP .Net' started by Ross Culver, Aug 7, 2007.

  1. Ross Culver

    Ross Culver Guest

    ASP 2.0; VS2005; IIS 6.0; textbox & gridview in multiview, in AJAX updatepanel

    After entering keywords into a textbox and clicking a button, a gridview is populated with applicable records. The parameter for the underlying query is a session variable populated when the button was clicked.

    That works fine.

    When the user selects one of the returning rows of the gridview he is redirected to another aspx page. When the user returns to the previous page by clicking the browser back button the multiview active grid is supposed to be set back to the one with the gridview on it based on the session variable not being empty.

    This worked fine until about a week ago. Now, in order to get the multiview activeview to be set back to the view with the grid on it, I have to click the refresh button. As far as I know, nothing has been changed in the application. FYI, when running the application on the server using the local files and ASP.Net development server, the page does what it's supposed to do. But the published version does not.

    Thanks for any help and time in advance.

    Ross

    Below is the code:


    Protected Sub Page_InitComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.InitComplete

    Try

    If Session.IsNewSession = True Then

    SetParameters()

    Refresh()

    Else

    'If there is a value in the QuickSearchPhrase session variable, do a search no matter what.

    If CType(Session.Item("QuickSearchPhrase"), String) <> "" And CType(Session.Item("QuickSearchPhrase"), String) <> Nothing Then

    Me.txtQuickSearch.Text = CType(Session.Item("QuickSearchPhrase"), String)

    Session.Item("TargetView") = 1

    Me.sqlQuickSearch.DataBind()

    Me.mvBody.ActiveViewIndex = 1

    Me.gvQuickSearch.PageIndex = CType(Session.Item("GridPageNo"), Integer)

    Me.gvQuickSearch.SelectedIndex = -1

    SetPagingLabels()

    Else

    'CurrentPage Action?

    If CType(Session.Item("CurrentPage"), Boolean) = True Then

    If CType(Session.Item("Action"), String) = "Back" Then

    'Go to the previous view.

    Me.mvBody.ActiveViewIndex = CType(Session.Item("OriginView"), Integer)

    Else

    'Go to the defined view.

    Select Case CType(Session.Item("TargetView"), Integer)

    Case 0

    Refresh()

    Case 1

    'This should actually never happen.

    'Me.txtMessage.Text = "This should never happen"

    Refresh()

    Case 2

    Me.mvBody.ActiveViewIndex = 2

    Case 3

    Me.mvBody.ActiveViewIndex = 3

    End Select

    End If

    Else

    'Go to the defined view

    Select Case CType(Session.Item("TargetView"), Integer)

    Case 0

    Refresh()

    Case 1

    'This should actually never happen.

    Me.txtQuickSearch.Text = CType(Session.Item("QuickSearchPhrase"), String)

    Me.sqlQuickSearch.DataBind()

    Me.mvBody.ActiveViewIndex = 1

    Me.gvQuickSearch.PageIndex = CType(Session.Item("GridPageNo"), Integer)

    Me.gvQuickSearch.SelectedIndex = -1

    SetPagingLabels()

    Me.txtMessage.Text = "Click the 'Home' button above to refresh this page."

    Case 2

    Me.mvBody.ActiveViewIndex = 2

    Case 3

    Me.mvBody.ActiveViewIndex = 3

    End Select

    End If

    End If

    End If

    Catch ex As Exception

    Me.txtMessage.Text = "InitComplete: " & Err.Description

    End Try

    End Sub
     
    Ross Culver, Aug 7, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. raj

    Upload not happening!

    raj, Jul 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    Joerg Jooss
    Jul 20, 2003
  2. Curt_C [MVP]

    Page_Load stopped happening???

    Curt_C [MVP], Jan 15, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    338
    John Spiegel
    Jan 15, 2004
  3. msnews.microsoft.com

    How do I show an error happening in Application_Start ?

    msnews.microsoft.com, Jan 31, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,869
    Scott Allen
    Jan 31, 2005
  4. Wayne  Wengert

    Refresh Not Happening

    Wayne Wengert, Feb 23, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    1,412
    Wayne Wengert
    Feb 25, 2005
  5. Smithers

    CSS File Refresh is Not Happening

    Smithers, May 10, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,188
    Vladimir V
    May 11, 2005
Loading...

Share This Page