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

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Interview Question >> Others >> Post New Question Subscribe to Interview Questions

How do you invoke a web method of web service in AJAX?

Posted By :Akhil Raj     Posted Date :August 27, 2009    Points :10   Category :Others 
In order to use a webmethod of a webservice, we need to add the reference of webservice in the <services> section of ScriptManager. Under services you have to configure the servicepath.

< asp:ScriptManager ID="ScriptManager1" runat="server">
< Services>
< asp:ServiceReference Path="..\service1.asmx" />
< /Services>
< /asp:ScriptManager>

Inside JAvascript Use methods of this service directly like

You can also find related Interview Question to How do you invoke a web method of web service in AJAX?  below: 

How do we invoke the crystal report web service?

We can consume the web service as a normal web service in .NET. The easiest way is by using the reportviewer control and specifying the asmx url in the report source property (More...)

Suppose you have created a WCF service. You have an interface stating your methods that must be exposed to the clients. But you have forgotten to specify "[OperationContract]" attribute in any of your method. What will happen ?

If you do not specify "[OperationContract] " in any of the methods in your interface then you will get the following error :-
IService1' has zero operations; a contract must have at least one operation

Here, Iservice is the name of my Interface. you can have your own name.
So, it is mandatory to label "[OperationContract] " attribute to at least one method while declaring your interface methods or ServiceContract.

What is Method overloading?

Method overloading occurs when a class contains two methods with the same name, but different signatures. (More...)

What is Method Overriding? How to override a function in C#?

Use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method.
You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override. (More...)

Can we call a base class method without creating instance?

Its possible If its a static method.

Its possible by inheriting from that class also.

Its possible from derived classes using base keyword. (More...)

What is Method used to bind the data into gridview ?

DataBind() Method used to bind the data into gridview (More...)

What method is used to place a value onto the top of a stack?

push() method, Push is the direction that data is being added to the stack. push() member method places a value onto the top of a stack. (More...)

What method removes the value from the top of a stack?

The pop() member method removes the value from the top of a stack, which is then returned by the pop() member method to the statement that calls the pop() member method. (More...)

Where is window Service Entries located in the system

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services (More...)

What is the Transport Protocol you use to call a Web Service ?

SOAP (Simple Object Access Protocol) is the preferred protocol. (More...)

What are the disadvantages of AJAX?

The disadvantages are:
a)Ajax is not so friendly with search engine indexing because it uses Javascript for much part of its code. Search engines generally do not index Javascript present in web pages.
b)Dynamically created pages created by ajax does not support back button which takes the user to the previous pages. (More...)

How can you reference current thread of the method ?

"Thread.CurrentThread" refers to the current thread running in the method."CurrentThread" is a public static property. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

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