I have sorting enabled in my gridview.
I sort through the gridview and press my button:
<asp:Button ID="btnback" runat="server" Text="Go Back to Counts" />
This code does this for me in pageload:
If Page.IsPostBack = False Then ViewState.Add("NbrPostbacks", "1")
Else ViewState.Item("NbrPostbacks") += 1 End If
btnback.PostBackUrl = String.Format("javascript:history.go(-{0});", ViewState.Item("NbrPostbacks")
When I added the radiobuttonlist
<asp:RadioButtonList ID="Pending" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="Populategrid" Height="16px"
RepeatDirection="Horizontal" Width="755px">
<asp:ListItem Value="250" >Pending Over 250</asp:ListItem>
<asp:ListItem Value="300">Pending Over 300</asp:ListItem>
<asp:ListItem Value="350">Pending Over 350</asp:ListItem>
<asp:ListItem Value="400" Selected="True">Pending Over 400</asp:ListItem>
</asp:RadioButtonList>
I have to go through all of the sorting I have done on the page before I get back to the orginal page:
Do I need to put this in the btnback_client event and if I do, do I change the code?
Protected Sub btnback_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnback.Click
If Page.IsPostBack = False Then
ViewState.Add("NbrPostbacks", "1") Else
ViewState.Item("NbrPostbacks") += 1 End If
btnback.PostBackUrl = String.Format("javascript:history.go(-{0});", ViewState.Item("NbrPostbacks"))
End Sub