Updating contentplaceholder after initial load.....

Discussion in 'ASP .Net' started by chrisexv6, Jul 3, 2007.

  1. chrisexv6

    chrisexv6 Guest

    I have a master/content page setup on a site Im writing. In the
    master page there are 3 panes...nav, content, toolbar.

    The nav pane holds a bunch of search options (order number, date,
    etc). The user will fill in a search field then press the appropriate
    search button. The content pane is then displayed with a custom user
    control that shows the search results. That control also links to an
    order detail screen which then takes the place of the search results
    in the same content pane. The search results and order details pages
    are both content pages subscribing to the same master, and in each of
    those pages are user controls for the appropriate action.

    This all works perfectly fine the first time you search. But if you
    are looking at details of an order and then try to search again (the
    nav pane never gets hidden so search is always available), the content
    pane is never updated with the new search results. Ive debugged some
    of it and noticed that the search results content page page_load is
    never firing that second time. In fact, the order details page_load
    *is* firing, even though I should be showing search results and not
    details of an order.

    Am I missing something as to how I need to specify what page shows up
    in the contentplaceholder? It seems that I somehow need to tell the
    placeholder to reload the search results page in place of the order
    details. I just havent found a way to do it (is there a way? am I
    completely wrong with my implementation of master/content?)

    Thanks in advance.

    -Chris
     
    chrisexv6, Jul 3, 2007
    #1
    1. Advertising

  2. Sounds to me like you might want to have a MultiView control with defined
    Views inside that ContentPlaceHolder. Then you can easily have your code make
    one or the other views the active view, for example, in response to the
    search button being clicked.
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder(BETA): http://www.blogmetafinder.com



    "chrisexv6" wrote:

    > I have a master/content page setup on a site Im writing. In the
    > master page there are 3 panes...nav, content, toolbar.
    >
    > The nav pane holds a bunch of search options (order number, date,
    > etc). The user will fill in a search field then press the appropriate
    > search button. The content pane is then displayed with a custom user
    > control that shows the search results. That control also links to an
    > order detail screen which then takes the place of the search results
    > in the same content pane. The search results and order details pages
    > are both content pages subscribing to the same master, and in each of
    > those pages are user controls for the appropriate action.
    >
    > This all works perfectly fine the first time you search. But if you
    > are looking at details of an order and then try to search again (the
    > nav pane never gets hidden so search is always available), the content
    > pane is never updated with the new search results. Ive debugged some
    > of it and noticed that the search results content page page_load is
    > never firing that second time. In fact, the order details page_load
    > *is* firing, even though I should be showing search results and not
    > details of an order.
    >
    > Am I missing something as to how I need to specify what page shows up
    > in the contentplaceholder? It seems that I somehow need to tell the
    > placeholder to reload the search results page in place of the order
    > details. I just havent found a way to do it (is there a way? am I
    > completely wrong with my implementation of master/content?)
    >
    > Thanks in advance.
    >
    > -Chris
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jul 3, 2007
    #2
    1. Advertising

  3. chrisexv6

    chrisexv6 Guest

    What seems to be happening is this:

    1. Enter site, search for order number.
    2. Search results show in content pane (generated by a user control)
    3. Inside content pane one column is a hyperlink. That hyperlink when
    clicked goes to the details content page, which changes the content
    pane to show details.
    4. Subsequent searches (from the left pane) just refresh the content
    pane with the content that already exists.

    I know that the incorrect (or at least unexpected) Page Load/init
    function is being fired after the first search. Im assuming its
    because the details page is in the content pane, because that also
    happens to be the Page Load that is firing.

    Im not sure if a multiview would work for me.....I dont know where to
    put code that says "if button A is pressed from the master, run the
    searchresults control methods, then display the search results
    content". Once Im in the details view I seem to only have access to
    methods from the details view. Ive even tried response.redirect based
    on if the page was posting back. All that does is bring me to a blank
    content page, because I didnt fire any events in the searchresults
    control. The closest Ive gotten is adding event handlers to the
    details control that refer to the events in the results control. The
    problem there is that the results control has no notion of a master
    page after coming from the details page. So I just get object
    reference not set errors when referring to the master page values.

    The fact that this isnt simple leads me to believe maybe Im
    implementing the whole thing incorrectly.

    -Chris

    On Jul 3, 10:26 am, Peter Bromberg [C# MVP]
    <> wrote:
    > Sounds to me like you might want to have a MultiView control with defined
    > Views inside that ContentPlaceHolder. Then you can easily have your code make
    > one or the other views the active view, for example, in response to the
    > search button being clicked.
    > -- Peter
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > BlogMetaFinder(BETA): http://www.blogmetafinder.com
    >
    > "chrisexv6" wrote:
    > > I have a master/content page setup on a site Im writing. In the
    > > master page there are 3 panes...nav, content, toolbar.

    >
    > > The nav pane holds a bunch of search options (order number, date,
    > > etc). The user will fill in a search field then press the appropriate
    > > search button. The content pane is then displayed with a custom user
    > > control that shows the search results. That control also links to an
    > > order detail screen which then takes the place of the search results
    > > in the same content pane. The search results and order details pages
    > > are both content pages subscribing to the same master, and in each of
    > > those pages are user controls for the appropriate action.

    >
    > > This all works perfectly fine the first time you search. But if you
    > > are looking at details of an order and then try to search again (the
    > > nav pane never gets hidden so search is always available), the content
    > > pane is never updated with the new search results. Ive debugged some
    > > of it and noticed that the search results content page page_load is
    > > never firing that second time. In fact, the order details page_load
    > > *is* firing, even though I should be showing search results and not
    > > details of an order.

    >
    > > Am I missing something as to how I need to specify what page shows up
    > > in the contentplaceholder? It seems that I somehow need to tell the
    > > placeholder to reload the search results page in place of the order
    > > details. I just havent found a way to do it (is there a way? am I
    > > completely wrong with my implementation of master/content?)

    >
    > > Thanks in advance.

    >
    > > -Chris
     
    chrisexv6, Jul 3, 2007
    #3
    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. bruce barker

    Re: NGen -- SPEED UP DLL INITIAL LOAD

    bruce barker, Jun 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    404
    bruce barker
    Jun 30, 2004
  2. Greg
    Replies:
    4
    Views:
    14,892
    dassyms
    Apr 17, 2006
  3. Replies:
    0
    Views:
    497
  4. news.rcn.com
    Replies:
    2
    Views:
    1,127
    Roedy Green
    Dec 10, 2007
  5. Greg
    Replies:
    1
    Views:
    205
    Ward Bekker
    Mar 23, 2006
Loading...

Share This Page