.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Capture event of a POP UP Window from the Caller window

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :WPF
I have two .xaml pages in my application from the button click of 1st .xaml page i m doin secondpage.showDialog() so the second page comes up as a popup.
There is a button on the second page too.

Now i want that the click event of the button on the second page, to be captured on the first page.

How do i do that

Regards Kuldeep Gupta

View Complete Post

More Related Resource Links

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

Binding an event method from a control in a seperate window

How would you bind a event method from a control back to a seperate window?  I have a ActiveX control hosted in a WindowsFormsIntegration wrapper.  That is operating in its own window along with all its events.  The properties of the control are handled by a class that defines the dependency objects (thanks Bob) to provide a view model between it and a window with controls for setting/getting those properties.  Since events constrained to Window 2, is it possible to bind the events back to Window 1?

What event (if any) is fired on calling ShowDialog on hidden window

I initialize a window at the launch of my application and hide it, so that when the user needs to launch it I can quickly show it. I am using showDialog to show the window. I use this window at multiple places. So when the user is done using the window I again hide it. My question is how does the window know that it is visible. 'Loaded' event is no longer fired when I can ShowDialog to show the window. ('Loaded' event is fired the first time I create the window and hide it). Is there any other event that is fired on calling 'ShowDialog' on a hidden window? Thanks for your response.  

Send values to parent window on gridview click event


Hello all,

I have a form, which contains 2 textboxes. When i click on the first textbox, i have to open a child window (tool), that contains a gridview control with 2 columns (corresponding to the 2 textboxes). When the user clicks on any row in the gridview, it should send back the 2 column values back to the parent window to the corresponding 2 textboxes. Can anyone help me on how do i achieve this?

I can open the child window and get back the values using window.opener method in JS. 

But can anyone help on how to bind the JS code to the onClick of every row in the gridview. How can i activate the OnClick event of every row/alternating row item of the gridview and bind the JS code and pass each column value to that JS method? The no of columns in the gridview can vary depending upon the data? So in that case, i have to have a collection to be passed to JS code that can contain n number of column values.

Please help.

Unexpected window.open Event


I have a small amount of experience with ASP.Net and I have inherited a project that has gone through many hands. I'm not sure if anyone can help me on this, but here goes. 

I have an .aspx page (Home.aspx) with an image button (ibEdit) and a link button (btnEditExpiration). The image button was created by another developer before I inherited the project. It is designed to reveal a hidden part of the page, with fields to edit customer information. I have added the link button to open another form  (EditExpirationDates.aspx), populated with information from Home.aspx 

When I click on ibEdit, everything works as expected. When I click on btnEditExpiration everything works as expected. The problem arises after I click on the btnEditExpiration button. Thereafter, every time I click on ibEdit , it's as if both click events fire and the EditExpirationDates.aspx form opens .

If I close the page and reopen it everything works fine until I click the btnEditExpiration.

Any suggestions would be appreciated.

Code shown below:


Exception thrown when handling Window.Loaded event


Why is the exception assistant not "fired" in a debugging session when a Window.Loaded eventhandler calls code which throws an exception ?
        private void Window_Loaded(object sender, RoutedEventArgs e)
            //Application.Current.DispatcherUnhandledException +=
               new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(Current_DispatcherUnhandledException);
            int a = 1;
            int b = 0;
            int c = a / b;

        void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)

Removing the comment signs (//) thus presenting an UnhandledException handler devinately makes the assistant "firing".
Is this behaviour by desi

Open a new Window on Button_click event


Hello, I am learning Visual Studio 2008 on the fly.

I'd like to get a help on how to open a new window when the report is opened for view.


1. Populate the asp:DropDownList to fill PDF file names

2. Select the report and click asp:Button

3. Pop a new window to browse the PDF file.

1 and 2 are working fine but for #3 - the report shows up but I can't goback to Home page unless i kill the window and restart the App or use the back button on IE.

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim org = "C:\Documents and Settings\My Documents\PDF\"


Fast bitmap capture of layered WPF window



I'm looking for a fast way to get a bitmap of a given layered WPF window (using a window handle). The window is a semi-transparent WPF window, and the application is running under Windows XP (not Vista or 7, this is a strong requirement).

I tried quite a few things before looking into DirectX :

- GDI+ : fast but I could not preserve real transparency (can't get rid of the background window/desktop, I want to keep the graphics of the WPF window, nothing else)

- .NET/WPF capturing features (RenderTargetBitmap etc.) : preserve transparency but way too slow

So, I was looking for some kind of fast capture function (~50ms) and I thought maybe DirectX could be a solution. Having no experience at all with DirectX, I tried a couple of things but nothing worked the way I expected :)

The best I could came up was using SlimDX (I'm not a great C++ coder either ;-) ) and modifying some code found online :

using (SlimDX.Direct3D9.Surface surface = device.GetRenderTarget (0))
                using (SlimDX.Direct3D9.Surface surface2 = SlimDX.Direct3D9.Surface.

Button event lost after window.open



I have a form with a field which could be populated manually (by typing in it) or through a window.open popup window. The user just have to select the value in the window and it's written in the field of the parent window (all in javascript). 

When I enter the value manually, all is fine. However, when I do it through the popup window the value is correctly written in the parent window and the popup is closed, but the click event of the submit button is not raised when i submit the form. The Page Load event is raised and the IsPostBack is set to false.

What could be the problem?


Customising the Metadata capture Modal popup window



Can I customise the standard SharePoint modal window where the user specifies the metadata of a document before saving? I need to put in a tree view type meta navigation.

Can I do this?


How to trace to the event log from a WCF Service hosted in a Window Service.



I have a C#.NET Windows service that I use to host my WCF service. The Windows service basically does nothing but trace some event messages to the event log and host the WCF using ServiceHost.

Is there a way to have my WCF service also trace to the event log? How do I pass parameters to my hosted WCF service? Can I pass parameters? Do I need to use a service contract instead?

 I am new to WCF and WF so let me know if I'm missing something stupid here.



Hide window in Deactivated event only if not Closing



I'm trying to hide my application window if user clicks somewhere outside application.

But sometimes (not always) user gets "Cannot set Visibility or call Show, ShowDialog, Close, or Hide while window is closing" when trying to Close the app window.

private void Window_Deactivated(object sender, EventArgs e)
   //if not closing...

I need somehow define whether user is trying to close the window before hide it. I tried to subscribe Window_Closing event but is raised after deactivated.

Please, advise.

Thanks, Alexey. Develop with pleasure!

In XAML can I have a routed event from a control residing on a different window?


I have been given an application that seems to be opening many instances of the same window and I need to play a storyboard animation whenever this window (or any of its iterations) appears. I have tried GotFocus and Loaded but neither of them work when I want them to. GotFocus only works when I ALT+TAB select one of the iterations of the same window and subsequently close that window.

I am thinking that the easiest think to do is to have the storyboard triggered by the click events of buttons that reside within different windows. Also, if possible, I need this to be done using only XAML and not the code behind.

Is this possible?

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.

lossing focus from model pop up window controls


hi i using a model pop up window with some textbox but when i click on textbox of model pop up focus move to back to page textbox control plz help me 

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

Create a user friendly pop up window


Hello friends I am new to asp.net programming. While working with windows form(windows application) i have created a window for editing purpose(just like popup window ) which contains three bounded dropdown list a button and a gridview. After making selections from the drop down when we press button the corresponding result should display in a grid.After that when you click on the grid row it will load the corresponding datas in my form. i want to create such control in asp.net . i have to use jquery or ajax.And this pop up window i have to use more than twenty times in my application.am using VS2008 ASP.NET and C# 3.5 . Plese suggest me what to do. Thanks in advance

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend