.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

What is the difference between Control.Invoke(deligate) and Normal Method Call.

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

What is the difference between Control.Invoke(deligate) and Normal Method Call.

In which senarios we need Control.invoke(deligate) to call a method.

If any one knows please explain to me.

thank you.

View Complete Post

More Related Resource Links

Difference between normal DLL & .net DLL


Hi All,

What is a difference between a regular DLL & .net DLL ?

Thanks in adavnce

Call a web method in Javascript


Hi All,

I am first time working on web service and Javascript and trying to call a Web Method (web service) on a button click in Javascript.

What I want to achieve is as followed: When the button is clicked, call the web method, get the return URL value and store it to a session variable, the redirect the page to another page. However, this works only when the internet traffic is fast, it give me error when internet is slow as the Javascript is executed much faster than the web service. Is there any way to handle this?  Would be much appreciated for your help! Cheers.

Code as below:


function emailButton_onClick()


function getCurrentMapURL(getCurrentMapURLOnSuccess)
var proxy_url = 'WebService/GPSWebService.asmx/GetCurrentMap';

var response = map.print([proxy_url]);



function getCurrentMapURLOnSuccess()
emailAddress = document.getElementById('txtEmailAddress').value;

if(emailAddress != null)
alert('Do you want to send report

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?

Difference between Rating and RatingExtender control in ajax control toolkit

Hi, Can you tell the difference between Rating and RatingExtender asp.net ajax Control ? 

dynamic menu control call in login page

Hi ,i have declared two control in my master page , how wants to call this menu control in child page ( that is login page)i want to bind the menu control dynamically based on login previlagepublic Menu newMenu = new Menu();  public MenuItem newItem = new MenuItem("Master");

WCF Basic Http Binding - Two server requests per method call

We have a service that uses BasicHttpBinding/Transport Security/Windows Authentication and is hosted in IIS. I have created a unit-test application in VSTS and whenever we test a WCF method, Fiddler records two calls. 1st call - No authorization token is sent. The WCF service returns a 401 error - Unauthorized: Access is denied. Http headers as sent in the request given below. POST http://localhost/AccountScreen.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "IAccountScreen/RetrieveAccountDetails" Host: localhost Content-Length: 243 Expect: 100-continue Connection: Keep-Alive 2nd call - Authorization token is sent and the WCF service returns the expected response. POST http://localhost/AccountScreen.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "IAccountScreen/RetrieveAccountDetails" Authorization: Negotiate Host: localhost Content-Length: 243 Expect: 100-continue I am not able to figure out why there are two calls made to the server in the first place and what is the significance of the first call. Any thoughts?

How to call CodeBehind Method from Client Side

Hi forumers,How can we call a CodeBehind Method with Arguement from Client Side?Here is the idea: this wont work<script type='text/javascript"> function func(){ var str = 'Hello World'; var result = '<% =CodeBehindFunction( str ) %>' } </script>I have a variable "str" and has a value of "Hello World".. I want to pass the value of "str" to the CodeBehind Method which is "CodeBehindFunction(object obj)"..How can I accomplish this idea without the use of XMLhttprequest, is it possible?

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 a server side C# method from javascript

http://forums.asp.net/t/1591584.aspx Hi friends, can anyone provide me the C# code of the above post answer(pls go to the link)..i didnt understand the VB code... i dont know VB.. my problem also same.. i have a method in a class in App_Code folder... i want to call that method from javascript.. the method takes one parameter which is list box cotrol id... the list box control also available in the same page..   Please can anyone help me on this..

How to call a method with IDataObject in click event in wpf?

As I'm new in WPF development, I came up with a problem, looks like simple, however, I couldn't solve. The problem is, how to call a method with IDataObject in a click event?? I've a method like:  public void setProperty(IDataObject obj)         {                                      PropertyGrid mygrid = new PropertyGrid();                        UIElement elt = ExtractElement(obj);             Type t = elt.GetType();             string name = (string)t.GetProperty("Name").GetValue(elt, null);             mygrid.Instance = name;         } I want to call this method in a click event. I don't know how to. I've tried but couldn't yet. Any help will be appreciated regarding this. Thank you.   Regards, Binaya

AjaxToolkit's CascadingDropDown control is throwing Method Error 404 in Hybrid system environment (

Hi Experts, We have an Asp.net web application, which is deployed in shared hosting environment. On shared hosting environment initial request to this web application is handled by Linux server and then based on the requested page the Linux server is redirecting request to web server on windows OS. Now, in our web application, we have used ajaxToolkit's CascadingDropDown control to populate three levels of categories. In the hybrid system described above, the CascadingDropDown control is throwing Method Error 404. I would appreciate if some body can guide on how to resolve this issue. The sample of code snap shot is mentioned below. ********************************************************************* Aspx file. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <asp:DropDownList ID="ddlMajorLevelCategory" runat="server" Width="250px" ToolTip="Select Major Level Category" TabIndex="1"                            SkinID="h6BlueArial"> </asp:DropDownList>   <ajaxToolkit:CascadingDropDown ID="ccMajorCategory" runat="server" TargetControlID="ddlMajorLevelCategory" Category="M" PromptText=&qu

WPF method call between 2 Windows

I have a Window called MenuWindow and ControlWindow and I wanted the call a method void Sync() in ControlWindow from MenuWindow Im confused because i havent done this through 2 windows that were not the MainWindow. Normally i would do it like so ((MainWindow)Application.Current.MainWindow).Sync(); but how do i do it if its not the main Window?

Is there a method that returns the control's type, such as "TextBox", "TextBlock", "Canvas", etc.,

Hello, I have a method that is passed in a FrameworkElement Ctrl.  When I use Ctrl.GetType().ToString() I get "System.Window.Controls.TextBox" or another string if a different type of control is passed in.  All I am interested in is the text after the last dot/period.  In my searching I thought I came across something that just returned the portion I'm looking for, but now can't find it. Is there a method that returns the control's type, such as "TextBox", "TextBlock", "Canvas", etc., without its parents? Regards, Robert

dgw programmatically call a method

I have a method on a dataGridView, which is fully addressed like this: private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //code }   I would like to access to this method programmatically, without mouse double click. And I have to pass a parameter of a row index. I have tried to pass an integer, but I got an error (cannot convert from 'int' to 'System.Windows.Forms.DataGridViewCellEventArgs), like: foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value.ToString() == _myCellName) { dataGridView1.Rows[row.Index].Selected = true; dataGridView1_CellDoubleClick(null, row.Index); //here Im trying to pass a value for the upper method break; } }   When the upper method (dgw_CellDoubleClick) is programmatically called, I would like to call an "e", with: if(e.RowIndex > 0) { //code } So what to pass from to the method, that will work?

ILGenerator : call DynamicMethod with Emit method

A sample of what I try to do :     class Program     {         static void Main(string[] args)         {             GenerationIL();         }         public static void GenerationIL()         {             Action oDynamicMethod = DynamicMethod();             DynamicMethod dm = new DynamicMethod("Run", null, Type.EmptyTypes);             ILGenerator oILGenerator = dm.GetILGenerator();             oILGenerator.Emit(OpCodes.Call, oDynamicMethod.Method); // Runtime ERROR             oILGenerator.Emit(OpCodes.Ret);             ((Action)dm.CreateDelegate(typeof(Action))).Invoke();         }         public static Action DynamicMethod()         {             DynamicMethod dm = new DynamicMethod("Todo", null, Type.EmptyTypes);             ILGenerator oILGenerator = dm.GetILGenerator();          &nbs

Is there a way to save a refernece to a method in a Tag property and call that method directly from

Hello, Here is a tough one, probably only answerable by someone who really knows his stuff. In the WPF program below, I would like to completely eliminate the necessity of the "LoadIt" method.  The way I'd like to do it is by saving the address ( or some other appropriate information ) of the method to be called to add a Person or Pet to the Expander's Tag.  Then, when the Add button is clicked, the Expander's Tag is read and the method saved therein is called.  The comments in the code below give the gist of what I would like to happen, if such is possible.  The actual application this will be applied to has many groups to add, thereby making the switch statement in the "LoadIt" method huge.  That is what I would like to avoid. Here is the fully functional test program: XAML: <Window x:Class="MethodAsParameter_01.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="Window_Loaded" Title="MainWindow" Height="350" Width="525"> <Grid> <ScrollViewer> <StackPanel Name="Root" Orientation="Vertical" ButtonBase.Click="Root_Click" /> </ScrollViewe

How to force web method to call another method by default

I want to call one method by default before each web method execution. But I don't want to add any extra code in web method.Regards, Jaydeep
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