Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Main Web Page interacting with Search Web Page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DavidS - 27 Mar 2008 17:34 GMT
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] - 27 Mar 2008 18:39 GMT
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

> 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
[quoted text clipped - 26 lines]
> Kind regards for help/assistance in this matter,
> David
DavidS - 27 Mar 2008 19:26 GMT
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 ///

> This article is a bit old, but I think it will clearly illustrate an easy way
> to do this:
[quoted text clipped - 35 lines]
> > Kind regards for help/assistance in this matter,
> > David
bruce barker - 28 Mar 2008 01:05 GMT
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)

> The article is an excellent one.  But I think for my purposes it's limited in
> what I currently doing.
[quoted text clipped - 60 lines]
> > > Kind regards for help/assistance in this matter,
> > > David
DavidS - 28 Mar 2008 19:52 GMT
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

> 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.
[quoted text clipped - 70 lines]
> > > > Kind regards for help/assistance in this matter,
> > > > David

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.