Go Back to Search Results Page

Discussion in 'ASP .Net' started by bendlam, Jul 29, 2007.

  1. bendlam

    bendlam Guest

    I have a page that contains search criteria and when you click on the
    search button it causes a post back that populates a dataview on the
    same page. One of the gridview columns contains a link that navigates
    to a details page. When I try to go back to the search results page i
    get "Page cannot be displayed" error. How do i go back to the search
    results and have the search criteria and dataview unchanged?

    i.e. The behaviour I'm looking for is as follows:
    1. Search.aspx postback populates DataView.
    2. Click on Details column takes you to Details.aspx
    3. Hit back on browser or using a javascript link to go back would
    return to the Search.aspx page with the user's search criteria and the
    current DataView position.

    Any help is much appreciated.

    Thanks
     
    bendlam, Jul 29, 2007
    #1
    1. Advertising

  2. You can post to another page. Instead of posting back to the same
    page, which is the default, you can specify the page to post to. Look
    at the PostBackURL property of the control that you want your user to
    click. I know the System.Web.UI.WebControls.Button has the property.

    On Jul 28, 10:02 pm, bendlam <> wrote:
    > I have a page that contains search criteria and when you click on the
    > search button it causes a post back that populates a dataview on the
    > same page. One of the gridview columns contains a link that navigates
    > to a details page. When I try to go back to the search results page i
    > get "Page cannot be displayed" error. How do i go back to the search
    > results and have the search criteria and dataview unchanged?
    >
    > i.e. The behaviour I'm looking for is as follows:
    > 1. Search.aspx postback populates DataView.
    > 2. Click on Details column takes you to Details.aspx
    > 3. Hit back on browser or using a javascript link to go back would
    > return to the Search.aspx page with the user's search criteria and the
    > current DataView position.
    >
    > Any help is much appreciated.
    >
    > Thanks
     
    Bill Nicholson, Jul 29, 2007
    #2
    1. Advertising

  3. bendlam

    Masudur Guest

    On Jul 29, 8:02 am, bendlam <> wrote:
    > I have a page that contains search criteria and when you click on the
    > search button it causes a post back that populates a dataview on the
    > same page. One of the gridview columns contains a link that navigates
    > to a details page. When I try to go back to the search results page i
    > get "Page cannot be displayed" error. How do i go back to the search
    > results and have the search criteria and dataview unchanged?
    >
    > i.e. The behaviour I'm looking for is as follows:
    > 1. Search.aspx postback populates DataView.
    > 2. Click on Details column takes you to Details.aspx
    > 3. Hit back on browser or using a javascript link to go back would
    > return to the Search.aspx page with the user's search criteria and the
    > current DataView position.
    >
    > Any help is much appreciated.
    >
    > Thanks


    Hi,

    After Search when you navigate to detail page... if you hit browsers
    back button you are suppose to get back to exactly in the same
    position and if you click on another item it will work just fine...
    because of pages viewstate... the state of the page will do just
    fine... may be you are missing some thing... one more thing you can
    also provide your user a option to navigate to search page from detail
    page implemented all by yourself. in that case do save the search
    criteria or search result in session when user search a new result
    set... and when click on detail... take user to detail... in detail
    page add some button or link which says "back to search page..." or
    perhaps "close" after click on the button don't do any javascript
    history back... just simple postback when in response.redirect to your
    search page... and repopulate the research result aswell as the search
    criteria of the user...

    Thanks
    Md. Masudur Rahman (Munna)
    Kaz Software Ltd.
    www.kaz.com.bd
    http://munnacs.110mb.com
     
    Masudur, Jul 29, 2007
    #3
  4. bendlam

    bendlam Guest

    On Jul 29, 12:29 am, Masudur <> wrote:
    > On Jul 29, 8:02 am, bendlam <> wrote:
    >
    >
    >
    >
    >
    > > I have a page that contains search criteria and when you click on the
    > > search button it causes a post back that populates a dataview on the
    > > same page. One of the gridview columns contains a link that navigates
    > > to a details page. When I try to go back to the search results page i
    > > get "Page cannot be displayed" error. How do i go back to the search
    > > results and have the search criteria and dataview unchanged?

    >
    > > i.e. The behaviour I'm looking for is as follows:
    > > 1. Search.aspx postback populates DataView.
    > > 2. Click on Details column takes you to Details.aspx
    > > 3. Hit back on browser or using a javascript link to go back would
    > > return to the Search.aspx page with the user's search criteria and the
    > > current DataView position.

    >
    > > Any help is much appreciated.

    >
    > > Thanks

    >
    > Hi,
    >
    > After Search when you navigate to detail page... if you hit browsers
    > back button you are suppose to get back to exactly in the same
    > position and if you click on another item it will work just fine...
    > because of pages viewstate... the state of the page will do just
    > fine... may be you are missing some thing... one more thing you can
    > also provide your user a option to navigate to search page from detail
    > page implemented all by yourself. in that case do save the search
    > criteria or search result in session when user search a new result
    > set... and when click on detail... take user to detail... in detail
    > page add some button or link which says "back to search page..." or
    > perhaps "close" after click on the button don't do any javascript
    > history back... just simple postback when in response.redirect to your
    > search page... and repopulate the research result aswell as the search
    > criteria of the user...
    >
    > Thanks
    > Md. Masudur Rahman (Munna)
    > Kaz Software Ltd.www.kaz.com.bdhttp://munnacs.110mb.com- Hide quoted text -
    >
    > - Show quoted text -


    thanks for the response

    I understand that I can implement a button to postback to the original
    search results page but how do you prevent them from hitting the back
    button.

    My back button always gives me a "Page cannot be displayed" error.
    Why? The url doesn't change after I postback to get the search
    results, does that have something to do with it? Is there a IE setting
    I'm missing? Ideally I'd like to just go back and like you said the
    viewstate should be the same but why it doesn't work is driving me
    nuts...
     
    bendlam, Jul 29, 2007
    #4
  5. bendlam

    Steph Guest

    Does anyone have an answer to this as I am having the same problem, I
    have a search results page and when user clicks more info link and goes
    to details page hits back button page cannot be displayed error appears

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Steph, Jul 31, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    1
    Views:
    668
    S. Justin Gengo
    Aug 8, 2003
  2. =?Utf-8?B?c3Fsc3Rlcg==?=

    asp.net 1.1 - going back to search results

    =?Utf-8?B?c3Fsc3Rlcg==?=, Feb 1, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    660
    Nathan Sokalski
    Feb 3, 2006
  3. Jan Harders
    Replies:
    4
    Views:
    648
    zzapper
    Jul 9, 2004
  4. Abby Lee
    Replies:
    5
    Views:
    443
    Abby Lee
    Aug 2, 2004
  5. Craig Keightley
    Replies:
    10
    Views:
    272
    Craig Keightley
    Jun 29, 2005
Loading...

Share This Page