Last post Jan 21, 2016 02:23 PM by Scotland06!
Jan 21, 2016 05:25 AM|Scotland06!|LINK
Hello, I'm having trouble with one of my drop down list filters and post backs when viewing on an iPhone safari browser. I have a result set from a sql data source that feeds a data view. If I click on a hyperlink to go to another page (a location details
page), and then click the back button on the browser, when I select the filter again, it takes me back to the location details page.
It works fine in IE and FireFox.
Here is my code behind. I also read somewhere I should have Me.ClientTarget = "uplevel" in the page load, so I have that also.
Protected Sub ddlDeals_OnSelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlDeals.SelectedIndexChanged
Dim DealFilterValue As String
DealFilterValue = ddlDeals.SelectedValue
Dim dvDeal As New System.Data.DataView
Dim dtDeal As New System.Data.DataTable
dvDeal = dsSearchResults.Select(DataSourceSelectArguments.Empty)
dtDeal = dvDeal.ToTable()
dvDeal.RowFilter = "Special2 = '" + DealFilterValue + "'"
lvSearchResults.DataSource = dvDeal
On the html for the dropdown list, I have:
asp:DropDownList ID="ddlDeals" runat="server" Width="140px" BackColor="#E4E3E8" AutoPostBack="True" ForeColor="black" Font-Size="Smaller" OnSelectedIndexChanged="ddlDeals_OnSelectedIndexChanged">
<asp:ListItem Value="" >Deal Types</asp:ListItem>
<asp:ListItem Value="Cows" >Cows</asp:ListItem>
<asp:ListItem Value="Birds" >Birds</asp:ListItem>
<asp:ListItem Value="Cats" >Cats</asp:ListItem>
<asp:ListItem Value="Spiders" >Spiders</asp:ListItem>
<asp:ListItem Value="% Off Checkout" >% Off Checkout</asp:ListItem>
Help appreciated! Thanks.
Jan 21, 2016 08:37 AM|Weibo Zhang|LINK
Hi Scotland06! ,
I think you could refer to the following threads and try to prevent the page from caching to avoid this issue. After that, when you click the back button, the page would reload again.
Jan 21, 2016 02:23 PM|Scotland06!|LINK
Thanks Weibo. I think that will work for now. The only thing is that the filter needs to be re-selected once the user navigates back. but I think I have an example on how to preserve that.