Main Web Page interacting with Search Web Page

Discussion in 'ASP .Net' started by DavidS, Mar 27, 2008.

  1. DavidS

    DavidS Guest

    I have for purposes of this discussion two web forms I'm working with : i)
    main.aspx, ii) find.aspx. From the main web form I have a button control
    that opens a modeless dialog (find.aspx,,,) etc... From the search page
    [find.aspx], I have several web controls that are used to control a query
    from SQL database [ex: name, location, start date, end date, rule #, etc...].

    Overview - I open the modeless dialog without issue from main form
    [main.aspx]. I control the query without issue in the search form
    [find.aspx]. I've set the tag <base target=_self> to ensure requeries from
    the search page repost to the same page - find.aspx.

    Objective - After I update the search page with a table datasets (that's
    dynamically constructed based on search criteria - and no issue / works
    perfect), I also have created the first table column as an "anchor - via <a
    href [some unique id] onclick event=[some javascript function]>. What I WANT
    to do is from the search page, depress ANY entry from the first column of
    table - and have this unique ID saved as session variable / than have the
    main web page update itself accordingly based on the ID selected.

    ISSUE/HELP!!! - I'm not able to force the main page to repost and read the
    session state variable! Is this possible / using a search page to tell the
    main page to update itself - how do I do this?

    NOTE: I'm not using frames - and not sure how to tell system to have parent
    repost - something like window.parent.opener.navigate(main.aspx) / this
    doesn't work - but this is goal - use the modeless form to query database /
    have the main page update itself based on selection from search page.

    Kind regards for help/assistance in this matter,
    David
    DavidS, Mar 27, 2008
    #1
    1. Advertising

  2. This article is a bit old, but I think it will clearly illustrate an easy way
    to do this:

    http://www.eggheadcafe.com/articles/20060117.asp
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short Urls & more: http://ittyurl.net


    "DavidS" wrote:

    > I have for purposes of this discussion two web forms I'm working with : i)
    > main.aspx, ii) find.aspx. From the main web form I have a button control
    > that opens a modeless dialog (find.aspx,,,) etc... From the search page
    > [find.aspx], I have several web controls that are used to control a query
    > from SQL database [ex: name, location, start date, end date, rule #, etc...].
    >
    > Overview - I open the modeless dialog without issue from main form
    > [main.aspx]. I control the query without issue in the search form
    > [find.aspx]. I've set the tag <base target=_self> to ensure requeries from
    > the search page repost to the same page - find.aspx.
    >
    > Objective - After I update the search page with a table datasets (that's
    > dynamically constructed based on search criteria - and no issue / works
    > perfect), I also have created the first table column as an "anchor - via <a
    > href [some unique id] onclick event=[some javascript function]>. What I WANT
    > to do is from the search page, depress ANY entry from the first column of
    > table - and have this unique ID saved as session variable / than have the
    > main web page update itself accordingly based on the ID selected.
    >
    > ISSUE/HELP!!! - I'm not able to force the main page to repost and read the
    > session state variable! Is this possible / using a search page to tell the
    > main page to update itself - how do I do this?
    >
    > NOTE: I'm not using frames - and not sure how to tell system to have parent
    > repost - something like window.parent.opener.navigate(main.aspx) / this
    > doesn't work - but this is goal - use the modeless form to query database /
    > have the main page update itself based on selection from search page.
    >
    > Kind regards for help/assistance in this matter,
    > David
    >
    >
    >
    Peter Bromberg [C# MVP], Mar 27, 2008
    #2
    1. Advertising

  3. DavidS

    DavidS Guest

    The article is an excellent one. But I think for my purposes it's limited in
    what I currently doing.

    1) The popup I open is required to remain opened after selecting an item
    associated with the search query - the popup from the example uses the Close
    button and than the associated window.opener.update( ret ); to force the
    postback - I believe.
    2) Issue I'm having is I don't want to close the current window after a post
    - hence / simple solution would be to remove the window.close in the
    Page_Load.Done() function - but I believe after a repost, the popup would
    either repost itself in a new window too - hence I used <target =_base> to
    ensure new posts are always the same window. Upon doing this - I believe
    window.opener is now undefined - doesn't point to main form again!

    I can't seem to force the main window to repost - repaint etc... /
    window.opener is undefined after I depress the Submit button on search page -
    since i) it will do SQL query of data; ii) update form with what it's found.

    Is there anyway to have the Handle for the main page - saved - and then use
    this handle in the popup I have in some way to force the main window to
    update?

    something like <hwnd of main page>.update() - I can call this from my
    javascript from from the popup - but not able to find something as such ///



    "Peter Bromberg [C# MVP]" wrote:

    > This article is a bit old, but I think it will clearly illustrate an easy way
    > to do this:
    >
    > http://www.eggheadcafe.com/articles/20060117.asp
    > -- Peter
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > Short Urls & more: http://ittyurl.net
    >
    >
    > "DavidS" wrote:
    >
    > > I have for purposes of this discussion two web forms I'm working with : i)
    > > main.aspx, ii) find.aspx. From the main web form I have a button control
    > > that opens a modeless dialog (find.aspx,,,) etc... From the search page
    > > [find.aspx], I have several web controls that are used to control a query
    > > from SQL database [ex: name, location, start date, end date, rule #, etc...].
    > >
    > > Overview - I open the modeless dialog without issue from main form
    > > [main.aspx]. I control the query without issue in the search form
    > > [find.aspx]. I've set the tag <base target=_self> to ensure requeries from
    > > the search page repost to the same page - find.aspx.
    > >
    > > Objective - After I update the search page with a table datasets (that's
    > > dynamically constructed based on search criteria - and no issue / works
    > > perfect), I also have created the first table column as an "anchor - via <a
    > > href [some unique id] onclick event=[some javascript function]>. What I WANT
    > > to do is from the search page, depress ANY entry from the first column of
    > > table - and have this unique ID saved as session variable / than have the
    > > main web page update itself accordingly based on the ID selected.
    > >
    > > ISSUE/HELP!!! - I'm not able to force the main page to repost and read the
    > > session state variable! Is this possible / using a search page to tell the
    > > main page to update itself - how do I do this?
    > >
    > > NOTE: I'm not using frames - and not sure how to tell system to have parent
    > > repost - something like window.parent.opener.navigate(main.aspx) / this
    > > doesn't work - but this is goal - use the modeless form to query database /
    > > have the main page update itself based on selection from search page.
    > >
    > > Kind regards for help/assistance in this matter,
    > > David
    > >
    > >
    > >
    DavidS, Mar 27, 2008
    #3
  4. DavidS

    bruce barker Guest

    a postback is really a nav to a new page as far as the browser is concerned.
    for security reason a new page can not access the opener of a previous page.

    you should abandon the popup page model for this type of application. the
    more common approach is to use a floating div to hold your find, and then a
    post in find is a post of the page. you can find lots of javascript code
    samples for this. the ajx control toolkit has one, so does jQuery.

    -- bruce (sqlwork.com)


    "DavidS" wrote:

    > The article is an excellent one. But I think for my purposes it's limited in
    > what I currently doing.
    >
    > 1) The popup I open is required to remain opened after selecting an item
    > associated with the search query - the popup from the example uses the Close
    > button and than the associated window.opener.update( ret ); to force the
    > postback - I believe.
    > 2) Issue I'm having is I don't want to close the current window after a post
    > - hence / simple solution would be to remove the window.close in the
    > Page_Load.Done() function - but I believe after a repost, the popup would
    > either repost itself in a new window too - hence I used <target =_base> to
    > ensure new posts are always the same window. Upon doing this - I believe
    > window.opener is now undefined - doesn't point to main form again!
    >
    > I can't seem to force the main window to repost - repaint etc... /
    > window.opener is undefined after I depress the Submit button on search page -
    > since i) it will do SQL query of data; ii) update form with what it's found.
    >
    > Is there anyway to have the Handle for the main page - saved - and then use
    > this handle in the popup I have in some way to force the main window to
    > update?
    >
    > something like <hwnd of main page>.update() - I can call this from my
    > javascript from from the popup - but not able to find something as such ///
    >
    >
    >
    > "Peter Bromberg [C# MVP]" wrote:
    >
    > > This article is a bit old, but I think it will clearly illustrate an easy way
    > > to do this:
    > >
    > > http://www.eggheadcafe.com/articles/20060117.asp
    > > -- Peter
    > > Site: http://www.eggheadcafe.com
    > > UnBlog: http://petesbloggerama.blogspot.com
    > > Short Urls & more: http://ittyurl.net
    > >
    > >
    > > "DavidS" wrote:
    > >
    > > > I have for purposes of this discussion two web forms I'm working with : i)
    > > > main.aspx, ii) find.aspx. From the main web form I have a button control
    > > > that opens a modeless dialog (find.aspx,,,) etc... From the search page
    > > > [find.aspx], I have several web controls that are used to control a query
    > > > from SQL database [ex: name, location, start date, end date, rule #, etc...].
    > > >
    > > > Overview - I open the modeless dialog without issue from main form
    > > > [main.aspx]. I control the query without issue in the search form
    > > > [find.aspx]. I've set the tag <base target=_self> to ensure requeries from
    > > > the search page repost to the same page - find.aspx.
    > > >
    > > > Objective - After I update the search page with a table datasets (that's
    > > > dynamically constructed based on search criteria - and no issue / works
    > > > perfect), I also have created the first table column as an "anchor - via <a
    > > > href [some unique id] onclick event=[some javascript function]>. What I WANT
    > > > to do is from the search page, depress ANY entry from the first column of
    > > > table - and have this unique ID saved as session variable / than have the
    > > > main web page update itself accordingly based on the ID selected.
    > > >
    > > > ISSUE/HELP!!! - I'm not able to force the main page to repost and read the
    > > > session state variable! Is this possible / using a search page to tell the
    > > > main page to update itself - how do I do this?
    > > >
    > > > NOTE: I'm not using frames - and not sure how to tell system to have parent
    > > > repost - something like window.parent.opener.navigate(main.aspx) / this
    > > > doesn't work - but this is goal - use the modeless form to query database /
    > > > have the main page update itself based on selection from search page.
    > > >
    > > > Kind regards for help/assistance in this matter,
    > > > David
    > > >
    > > >
    > > >
    bruce barker, Mar 28, 2008
    #4
  5. DavidS

    DavidS Guest

    Ok. Makes sense with security issues / I was having very difficult time
    doing anything with parent, window.opener, etc...

    Concerning jQuery - this is something new to me. I did do google query on
    this - lots of places to start. Is there any specific site you can
    recommend. Also, is there a location that might have an example too - since
    I believe I have to download jQuery and install - etc... and looks like might
    take some extra time. Any additional help will cut down on my searches in
    wrong direction too.

    thanks,
    David

    "bruce barker" wrote:

    > a postback is really a nav to a new page as far as the browser is concerned.
    > for security reason a new page can not access the opener of a previous page.
    >
    > you should abandon the popup page model for this type of application. the
    > more common approach is to use a floating div to hold your find, and then a
    > post in find is a post of the page. you can find lots of javascript code
    > samples for this. the ajx control toolkit has one, so does jQuery.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "DavidS" wrote:
    >
    > > The article is an excellent one. But I think for my purposes it's limited in
    > > what I currently doing.
    > >
    > > 1) The popup I open is required to remain opened after selecting an item
    > > associated with the search query - the popup from the example uses the Close
    > > button and than the associated window.opener.update( ret ); to force the
    > > postback - I believe.
    > > 2) Issue I'm having is I don't want to close the current window after a post
    > > - hence / simple solution would be to remove the window.close in the
    > > Page_Load.Done() function - but I believe after a repost, the popup would
    > > either repost itself in a new window too - hence I used <target =_base> to
    > > ensure new posts are always the same window. Upon doing this - I believe
    > > window.opener is now undefined - doesn't point to main form again!
    > >
    > > I can't seem to force the main window to repost - repaint etc... /
    > > window.opener is undefined after I depress the Submit button on search page -
    > > since i) it will do SQL query of data; ii) update form with what it's found.
    > >
    > > Is there anyway to have the Handle for the main page - saved - and then use
    > > this handle in the popup I have in some way to force the main window to
    > > update?
    > >
    > > something like <hwnd of main page>.update() - I can call this from my
    > > javascript from from the popup - but not able to find something as such ///
    > >
    > >
    > >
    > > "Peter Bromberg [C# MVP]" wrote:
    > >
    > > > This article is a bit old, but I think it will clearly illustrate an easy way
    > > > to do this:
    > > >
    > > > http://www.eggheadcafe.com/articles/20060117.asp
    > > > -- Peter
    > > > Site: http://www.eggheadcafe.com
    > > > UnBlog: http://petesbloggerama.blogspot.com
    > > > Short Urls & more: http://ittyurl.net
    > > >
    > > >
    > > > "DavidS" wrote:
    > > >
    > > > > I have for purposes of this discussion two web forms I'm working with : i)
    > > > > main.aspx, ii) find.aspx. From the main web form I have a button control
    > > > > that opens a modeless dialog (find.aspx,,,) etc... From the search page
    > > > > [find.aspx], I have several web controls that are used to control a query
    > > > > from SQL database [ex: name, location, start date, end date, rule #, etc...].
    > > > >
    > > > > Overview - I open the modeless dialog without issue from main form
    > > > > [main.aspx]. I control the query without issue in the search form
    > > > > [find.aspx]. I've set the tag <base target=_self> to ensure requeries from
    > > > > the search page repost to the same page - find.aspx.
    > > > >
    > > > > Objective - After I update the search page with a table datasets (that's
    > > > > dynamically constructed based on search criteria - and no issue / works
    > > > > perfect), I also have created the first table column as an "anchor - via <a
    > > > > href [some unique id] onclick event=[some javascript function]>. What I WANT
    > > > > to do is from the search page, depress ANY entry from the first column of
    > > > > table - and have this unique ID saved as session variable / than have the
    > > > > main web page update itself accordingly based on the ID selected.
    > > > >
    > > > > ISSUE/HELP!!! - I'm not able to force the main page to repost and read the
    > > > > session state variable! Is this possible / using a search page to tell the
    > > > > main page to update itself - how do I do this?
    > > > >
    > > > > NOTE: I'm not using frames - and not sure how to tell system to have parent
    > > > > repost - something like window.parent.opener.navigate(main.aspx) / this
    > > > > doesn't work - but this is goal - use the modeless form to query database /
    > > > > have the main page update itself based on selection from search page.
    > > > >
    > > > > Kind regards for help/assistance in this matter,
    > > > > David
    > > > >
    > > > >
    > > > >
    DavidS, Mar 28, 2008
    #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. John
    Replies:
    4
    Views:
    491
    Joe Agster
    Jul 2, 2003
  2. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    2
    Views:
    470
    Bruce Barker
    Nov 21, 2005
  3. Vaughn Haybittle

    Collection and multiple classes interacting via web service!?

    Vaughn Haybittle, Aug 3, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    204
    Vaughn Haybittle
    Aug 3, 2007
  4. Abby Lee
    Replies:
    5
    Views:
    381
    Abby Lee
    Aug 2, 2004
  5. Robert Oschler
    Replies:
    1
    Views:
    383
Loading...

Share This Page