Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > What's Happening When I Click Refresh?

Reply
Thread Tools

What's Happening When I Click Refresh?

 
 
Ross Culver
Guest
Posts: n/a
 
      08-07-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
click click click Andy Morrison Computer Support 7 12-20-2007 06:50 AM
What's happening Seth Cisco 2 12-06-2004 02:00 AM
Any ideas why this is happening ? IHateSpam Cisco 0 02-23-2004 09:20 PM
Whats happening to my router? Bryan Martin Cisco 5 01-10-2004 01:23 AM
Good news just keep on happening tommylee MCSD 0 07-22-2003 04:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57