Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Main Web Page interacting with Search Web Page

Reply
Thread Tools

Main Web Page interacting with Search Web Page

 
 
DavidS
Guest
Posts: n/a
 
      03-27-2008
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



 
Reply With Quote
 
 
 
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      03-27-2008
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
>
>
>

 
Reply With Quote
 
 
 
 
DavidS
Guest
Posts: n/a
 
      03-27-2008
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
> >
> >
> >

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      03-28-2008
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
> > >
> > >
> > >

 
Reply With Quote
 
DavidS
Guest
Posts: n/a
 
      03-28-2008
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
> > > >
> > > >
> > > >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection and multiple classes interacting via web service!? Vaughn Haybittle ASP .Net Web Services 0 08-03-2007 10:02 PM
C++.NET coding in window form client for interacting with WEb Serv =?Utf-8?B?ZGF2aWQ=?= ASP .Net 2 11-21-2005 11:29 PM
Change main window href from IE search panel, after user has left my main page? Robert Oschler Javascript 1 10-12-2004 08:34 PM
Usercontrol interacting with it's parent page? John ASP .Net 4 07-02-2003 03:38 AM



Advertisments