On Jun 30, 5:19 pm, "Bjorn Sagbakken" <bjo-...@online.no> wrote:
> With ASP.NET 2.0
>
> I want to add a nice and sleek feature to my application where the user
> typical clicks a button to open a smaller window to enable a search, lets
> say for customers or products or whatever.
>
> So far this is easy by adding a script tag and window.open with appropriate
> settings.
>
> The challenge comes when the user has searched and selected his item, and
> clicks [Ok] in this popup form.
> How do I return the values to the calling form, into the appropriate
> textboxes?
>
> If this cannot be done directly on the client side, I think this may be done
> with a postback of the caller form, but then; how do I force a callback of
> the first form (the caller form) when the secondary (the pop-up) closes?
>
> (And yes, I know the search issue can be solved with hiding/showing panels
> or views on an asp-form, but I would like to simulate a more windows like
> behaviour, if possible)
>
> Bjorn
Hi Bjorn
well you can access your parent pages elements using javascript...
here is a little code that will help you understand...
if(window.opener!=null)
{
window.opener.document.getElementById('Text1').val ue =
document.getElementById('Text2').value;
}
this is a script used in child page to set a value to a text box in
the parent page...
the trick is window.opener object of a page...
but i would like to suggest different technique...
why don't you user a javascript dhtml layer div popup and then use
javascript to hide and show the search box..
and also take advantage of Ajax to get the search result...
http://ajax.asp.net/ajaxtoolkit/ have few beautiful modal popup
demonstration
Thanks
Munna
www.kaz.com.bd
http://munnacs.110mb.com