Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Doubt new window

Reply
Thread Tools

Doubt new window

 
 
Paulo
Guest
Posts: n/a
 
      08-14-2007
Hi, when I click a Search button, must open a new window wich will list all
the customers on a grid, and the user can search, etc, but when the user
choose the customer, the window must be closed and returned to the original
window with the customer ID selected by the user...

How can I do that? any examples? Im using VS 2005 C# .net 2.0...

Thanks



 
Reply With Quote
 
 
 
 
=?Utf-8?B?TGFkaXNsYXYgTXJua2E=?=
Guest
Posts: n/a
 
      08-14-2007
Hi Paulo,
you have to use javascript. On the search button use something like
OnClientClick="javascript:OpenMyWindow(); return false;"

Now you have to define two javascript functions OpenMyWindow and UpdateValue
function.
function OpenMyWindow() {
window.open("~/Customers.aspx", other params to set up your new window);
}

function UpdateValue(returnCustomer) {
var customerTextBox = document.getElementById('customerTextBox');
customerTextBox.Value = returnCustomer; // updates value in some html
textbox

// you will probably have to refresh value here
if (document.createEvent) {
var onchangeEvent = document.createEvent('HTMLEvents');
onchangeEvent.initEvent('change', true, true);
customerTextBox.dispatchEvent(onchangeEvent);
}
else {
customerTextBox.fireEvent('onchange');
}
}

Customers.aspx will handle your grid with customers. You also need to
implement return mechanism on this page. Say for example if user select row
in grid it will return customer name back to previous window. You again need
to use javascript:

function Done(returnValue) {
window.opener.UpdateValue(returnValue); // calls UpdateValue defined in
previous window
window.close();
}

I don't say it will work exactly as I have described but at least it gives
you an idea.

Regards,
Ladislav


"Paulo" wrote:

> Hi, when I click a Search button, must open a new window wich will list all
> the customers on a grid, and the user can search, etc, but when the user
> choose the customer, the window must be closed and returned to the original
> window with the customer ID selected by the user...
>
> How can I do that? any examples? Im using VS 2005 C# .net 2.0...
>
> Thanks
>
>
>
>

 
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
dotnet doubt can any body clarify my doubt challa462@gmail.com ASP .Net 0 08-22-2012 06:02 AM
doubt about doubt Bob Nelson C Programming 11 07-30-2006 08:17 PM
How to post the data to a new window and control the new window's property? Matt ASP .Net 2 08-23-2004 05:29 PM
How to post the data to a new window and control the new window's property? Matt Java 1 08-22-2004 09:09 PM
How to use an asp:button to create a new browser window and output contents to new window =?Utf-8?B?Tm92aWNl?= ASP .Net 2 06-09-2004 10:54 PM



Advertisments