I have a drop down list with autopostback set to true on my aspx page. In my aspx.vb page, when an item is selected in the ddl, the user is redirected to the file associated with the item they clicked on. All of that works fine.
If the user clicks the back button, they are brought back to previous screen as excpected. However, anything they now click on redirects them back to the file they had selected before hitting the back button.
Here is the ddl in the aspx page:
asp:ListBox ID="lbDocuments" runat="server" Height="75" Width="500" Rows="8" AutoPostBack="True"
And here is the selected index change in the code behind:
Private Sub listBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbDocuments.SelectedIndexChanged
Dim curItem As String = lbDocuments.SelectedItem.ToString()
Response.Redirect("file://\\networkpathoffile" & curItem)
End Sub
Thanks in advance!
EDIT*
Page_Load--I have several buttons at the top that open a different set of labels/textboxes instead of a tab menu.
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
DisplayUn.Visible = True
DisplayAgreem.Visible = False
DisplayFin.Visible = False
DisplayDoc.Visible = False
DisplayCon.Visible = False
DisplayJur.Visible = False
End If
CreateMainTable()
End Sub
ASPX file
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="AgreementAdmin.aspx.vb" Inherits="AgreementAdmin" %>
<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" Runat="Server">
</asp:Content>
asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
<section>
Filter by Craft Type: <asp:DropDownList ID="ddlType" runat="server" AutoPostBack="True">
<asp:ListItem>Item1</asp:ListItem>
<asp:ListItem>Item2</asp:ListItem>
<asp:ListItem>Item3</asp:ListItem>
</asp:DropDownList>
</section>
<section id="DisplayDoc" runat="server">
<asp:Table ID="tblDocuments" runat="server" Width="755px">
<asp:TableRow runat="server">
<asp:TableCell runat="server">
<asp:Label ID="lblAgreementOnFile" runat="server" Text="Agreement on File "></asp:Label></asp:TableCell>
<asp:TableCell runat="server">
<asp:TextBox ID="txtAgreementOnFile" runat="server"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow runat="server">
<asp:TableCell runat="server">
<asp:Label ID="lblDocuments" runat="server" Text="Documents"></asp:Label></asp:TableCell>
<asp:TableCell runat="server">
<asp:ListBox ID="lbDocuments" runat="server" Height="75" Width="500" Rows="8" SelectionMode="Single" AutoPostBack="True" "></asp:ListBox></asp:TableCell>
</asp:TableRow>
</asp:Table>
</section>