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

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

How to call a Public function of a window from another Window in WPF

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :WPF

How to call a Public function of a Mainwindow from another Window in wpf using VB.Net?

I checked this thread and tried to implement similar way as follows

1. Created an instance for the main window and declared a public function

Public Interface IMainWindow

 Function Show_Tickets(ByVal p_Para As String) As Boolean

End Interface

2. In the Mainwindow

at Initialization part

Class MainWindow

 Implements IMainWindow

3. Implemented the Function

Public Function Show_Tickets(ByVal p_status As String) As Boolean

View Complete Post

More Related Resource Links

way of calling "javascript function of parent window from child window."

The article way of calling "javascript function of parent window from child window." was added by raja.s on Sunday, June 06, 2010.

Hi,Here i am going to explain how to call the javascript function of a parent window from the child window(pop-Up).Some may know before reading this post.Parent Java Script Function:script language="Javascript" type="text/javascript">

window.XMLHttpRequest - Is it possible to call the Method which is present on the same page?

Dear Friends, I am using the below XML HTTP Request for checking the username whether already exist or not, What i am doing is i am opeing a page on xmlhttp.open("GET", "CheckUserNameSupportiveFile.aspx?UserName=" + username, true); And passing the username to check with database. if (window.XMLHttpRequest) { // code for all new browsers xmlhttp = new XMLHttpRequest(); }if (xmlhttp != null) { xmlhttp.onreadystatechange = state_Change; var adad = username = document.getElementById('<%=txtUserName.ClientID %>').value; // alert(adad); xmlhttp.open("GET", "CheckUserNameSupportiveFile.aspx?UserName=" + username, true); xmlhttp.send(null); }but what i want to do is, IS IT POSSIBLE WITHOUT CALLING ANOTHER PAGE [CheckUserNameSupportiveFile.aspx?UserName=" + username ] Can i check it on the same page itself by calling method OR something on the same page itself.I do not want to pass the value to another page on and check it with DB, i want to do in same page itself.All your suggestion / advice are welcome.

Call parent window Page_Load when child closes

 I have a popup window that I open using  window.showModalDialog('Popup.aspx'); The client enters some information and then clicks a 'Save' button on the Popup window.  At that point I want the popup window to close and refresh the parent window which I though would execute the page_load event on the parent window. Here is the code that I have for the button click on the popup window. window.returnValue = true; window.close(); The popup window closes and it seems like the parent refreshes, but the page_load event on the parent is not called.  I put in a breakpoint to verify.  I need the page_load event to execute.   Thanks in advance for your help, JZ

How can I call the windows authentication window from C# code?





I have a windows application which tries to get information from the internet. But the connection to the internet can only be established through a proxy server.

Normally, the users who use the application log in with their credentials and that should automatically connect to the proxy server. But, for example, when you try opening Internet Explorer which is set up to use a proxy, it pops up the log-in window to authenticate to the proxy server, in case it is not saved.

My problem is, if it is saved, I can take the default credentials and proxy server using

System.Net.WebProxy.GetDefaultProxy(); (I know this is deprecated, but it works for me. I would appreciate a more elegant solution).



But, in case it is not saved, I want to pop-up the windows authentication window like the IE does. Is it possible to that? If yes, I would appreciate a little help, otherwise I have to write my own authentication window.

Please respond asap.

Thanks in advance.

EndScene function is called with several Direct3D devices.How to find out which one is a WPF window,



I am working on a screen grabbing application, which has a feature of grabbing a particular window. To make my application working with WPF applications with a good speed, I have chosen a "Direct3D hooking" approach for grabbing image of a WPF window, which means that I install hooks for some Direct3D calls, specifically, EndScene function. This works because WPF uses Direct3D for rendering windows contents.

However I ran into the following issue:
EndScene is called with several Direct3D devices, not a single one. I have looked into contents of each device's back buffer and found out that in addition to main window rendering, there are separate devices which are used for rendering of menus and tooltips.
However EndScene is called just with a pointer to a D3D device which is used for rendering and no information about whether a main window is rendered or a menu/tooltip. Also no information is available about position of menu/tooltip relative to main window coordinates (so that with that information I could compose a single image rendering images of window and menus/tooltips together).

So my question is: given Direct3D device which is used for rendering a window, how to identify a window (WPF window) by ob

How to Create and Call a Popup Window


VWD 2005 Express.  Visual Basic.  How may I create a "pop up" window (with it own controls for closing the window) and call it (open it) from the code behind?  Thanks for the help.

window.open call does not work in Dynamic Data Website


I have a Dynamic Data .net 3.5 website.  I am trying to have a popup display from the code behind.  Below is the code.  The calling form has an update panel surrounding the content.  I get a 404 'resource cannot be found' when it runs.  I have tried OpenNewWindow("ConfirmExam.aspx"); and OpenNewWindow("~Exams/ConfirmExam.aspx");.  The ConfirmExam.aspx and the calling page are in the same folder called Exams.  The calling page is a custom page iin /Custom Pages/Exams/Insert.aspx.  The ConfirrmExam.aspx page has yes and no buttons.  It executes code to go to a page based on the response.  I am open to suggestions.

//this is the method call

//this is the method definition
public void OpenNewWindow(string url)
               ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), "newWindow", String.Format("<script>window.open('{0}');</script>", url), false);


View Call Hierarchy window in Visual Studio 2010


Visual studio 2010 Ultimate is great IDE(Integrated Development Environment) and I am loving more and more whenever I found some thing new. While doing some Code and Review and other stuff with Visual Studio 2010 I have found one of most interesting feature in Visual Studio 2010 called "Called Hierarchy".You can navigate your code better with the Call Hierarchy feature in Visual Studio 2010.

To check out let's Create a sample asp.net MVC application like following .CallHirerchay

After creating a ASP.NET MVC 2 application it will create a basic simple application and we can run it and We have two views like home and about. We will check few code with Call Hirarchy. We can enable Call hierarchy window with two way one from the View->View Call Hierarchy like following or you can also use the shortcut Ctrl+Alt+K.

help to change from cursor to cte or window function or set based

Hi i have table lots of heartbeats i need to know when heartbeat started and when it stopped, and not all the heartbeats in between. Can be multiple heartbeat stops. Thanks
set nocount on
create table #temp (id int, alive bit, checktime datetime)
insert #temp values (1,1,dateadd(minute,-7,GETDATE()))
insert #temp values (1,1,dateadd(minute,-6,

How to call and open pop up window to send email


Hi I'm looking to add a pop window to my app the is called when press email heres my code.

Please advise novice :)


///main xaml

<Window x:Class="PetFile.MainWindow"
    Title="MainWindow" Height="450" Width="325">
    <Menu Name="menu1" DockPanel.Dock="Top">
      <MenuItem Header="_File">
        <MenuItem Header="_Load Data" x:Name="mnuLoad" Click="mnuLoad_Click" InputGestureText="Ctrl+L"></MenuItem>
        <MenuItem Header="_Save Data"></MenuItem>
      <MenuItem Header="_Quit!" x:Name="mnuQuit" Click="mnuQuit_Click"/>
        <ColumnDefinition Width="2*"></ColumnDefinition>
        <ColumnDefinition Width="4*"></ColumnDefinition>
      <!-- DisplayMemberPath ensures the pet_Name property is used to display a Pet in the listbox -->
      <ListBox x:Name="lbxPets" Se

Webservice whose webmethod has to call a window's service and get back the results


I have a question which might be a beginner's question in .Net.

I have a webservice whose webmethod has to call a window's service and get
back the results.

What is the best way to implement this scenario.

I am adding reference to this windows service as an exe and i could not figure out a
way call its methods from webservice.

Please help me with a speedy reply

 Thanks in advance


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 

Public Shared function doubt????

I am using VB.net/ASP.NET and SQL Server 2000 for a web application.

For populating the dropdowns, I wrote a Public Shared function LoadDDL(), in which I pass the dataset and dropdown name to set.

I have my doubts that this function will produce unexpected results for concurrent users. And will mix the results among sessions because it is a Shared function.

I am confused here. Is it the right way to go?

Please advice. Thanks in advance.


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

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

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