0

I am having an issue. So, I have a search screen, when the user searches, it takes them to the search results. Within the search results, there is a button to go back to their search and that takes them back to the previous page, but it takes them back to the start page. I need to be able to through C# have it select the drop down value and reload the page that they were in before that is within the main page.

<asp:Button ID="btnBacktoSearch" runat="server" Text="Back to Search"
            onclick="btnBacktoSearch_Click"/>


protected void btnBacktoSearch_Click(object sender, EventArgs e)
    {
       Response.Redirect("Search.aspx"); // Previous page
    }

As I said before, it does go back to the search page, but it does not reselect and re-open whatever I had previously selected in the drop down to load an iframe within the page. Can anyone help? I have a page load function that select the appropriate value of drop down, but it doesn't do the same thing as changing it from the main screen.

user2178477
  • 47
  • 2
  • 11
  • There are several ways to pass data between pages: http://stackoverflow.com/questions/14956027/how-to-pass-values-across-the-pages-in-asp-net-insted-of-session – Krisztián Balla Apr 07 '16 at 15:28
  • Are you sure you need C# and the server for this? See [Onclick javascript to make browser go back to previous page?](http://stackoverflow.com/questions/8067510) – mason Apr 07 '16 at 15:34
  • mason - I have tried that in my ASP button code and it doesn't work. – user2178477 Apr 07 '16 at 15:41
  • You can use HTML button and can do as @manson suggested.. It will be a quick and effective solution.. Or u want C# only? – maulik sakhare Apr 07 '16 at 18:10

0 Answers0