SlideShare a Scribd company logo
1 of 18
SynapseIndia DOTNET
Development AJAX Client Library
Type System : Class - Interface
ASP.NET AJAX Client Library-Type System: Class-Interface
Interfaces are a convenient way to define standard behaviors that other types can
implement .
An interface is a contract that states that the implementer of the interface must
provide all of the functionality specified in the interface.
The interface itself is only a specification and has no functionality of its own
Interface definitions follow the same pattern as creating classes
The function name is the name of the interface. The prototype of the function is
modified to add the interface members.
The convention in defining interface members is to throw Error.notImplemented for
each member, so any class that implements the interface then needs to
override the interface members to provide real implementations or the
exception will be thrown.
ASP.NET AJAX Client Library – Type System : Class - Interface
ASP.NET AJAX Client Library-Type System: Class-Interface
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET AJAX Interface</title>
<script type="text/javascript">
function pageLoad(sender, args)
{
Type.registerNamespace('Wrox.ASPAJAX.Samples');
Wrox.ASPAJAX.Samples.IProvideTrackInfo = function() {
throw Error.notImplemented();
}
Wrox.ASPAJAX.Samples.IProvideTrackInfo.prototype = {
get_trackCount: function() {
throw Error.notImplemented();
}
}
Wrox.ASPAJAX.Samples.IProvideTrackInfo.registerInterface
('Wrox.ASPAJAX.Samples.IProvideTrackInfo');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div> </div>
</form>
</body>
</html>
ASP.NET AJAX Client Library – Type System : Class - Interface
ASP.NET AJAX Client Library-Type System: Class-Enumeration
function pageLoad(sender, args) {
Type.registerNamespace('Wrox.ASPAJAX.Samples');
Wrox.ASPAJAX.Samples.MusicGenre = function() {
throw Error.invalidOperation();
}
Wrox.ASPAJAX.Samples.MusicGenre.prototype = {
Blues: 1,
Classical: 2,
Electronic: 3,
Folk: 4,
Industrial: 5,
Jazz: 6,
NewAge: 7,
HipHop: 8,
Rock: 9,
WorldFusion: 10
}
Wrox.ASPAJAX.Samples.MusicGenre.registerEnum
('Wrox.ASPAJAX.Samples.MusicGenre');
var genre =
Wrox.ASPAJAX.Samples.MusicGenre.Industrial;
alert(Wrox.ASPAJAX.Samples.MusicGenre.toString(ge
nre));
alert(genre ==
Wrox.ASPAJAX.Samples.MusicGenre.Industrial);
}
The ASP.NET AJAX type system provides
for defining enumerations and a
specialized version of them used as
combinable flags.
Enums let you establish a set of possible
values
ASP.NET AJAX Client Library – Type System : Class – Enumeration
ASP.NET AJAX Client Library-AJAX Base Class Library
Microsoft ASP.NET AJAX provides features that helps in creating client script and
integrate it into ASP.NET applications. This includes extensions to existing
ECMAScript (JavaScript) objects to give them the richness of .NET Framework
classes
The AJAX Library takes a familiar set of features from the Base Class Library of
the .NET Framework and brings it to JavaScript in the browser
Extensions to JavaScript base types provide additional functionality for these types.
• Array Type Extensions
• Boolean Type Extensions
• Date Type Extensions
• Error Type Extensions
• Number Type Extensions
• Object Type Extensions
• String Type Extensions
ASP.NET AJAX Client Library – AJAX Base Class Library
ASP.NET AJAX Networking
The core of AJAX development is the ability to make asynchronous web service
calls from JavaScript code.
Major web browsers have included an XMLHttpRequest object for making HTTP
requests.
The XMLHttpRequest object is used to perform out-of-band communications with
the server for invoking web services, executing callbacks, and performing
partial page updates.
ASP.NET AJAX provides classes for managing web requests, processing responses,
and detecting errors. It also provides support for serializing objects formatted
as JSON (JavaScript Object Notation), which makes them readily usable in
JavaScript in the browser.
• JSON is a standard serial format that is more lightweight than XML.
ASP.NET AJAX Networking
ASP.NET AJAX Networking- XMLHttpRequest Object
Remote Scripting:
• To minimize the impact of page redraws, primitive forms of scripted remote
procedure calls (RPC) appeared around 1997. Microsoft, in particular, pioneered this
field with a technology called Remote Scripting (RS).
• RS employed a Java applet to pull in data from a remote Active Server Pages (ASP)-
based URL. The URL exposed a contracted programming interface through a target
ASP page and serialized data back and forth through plain strings. On the client, a
little JavaScript framework received data and invoked a user-defined callback to
update the user interface via Dynamic HTML or similar techniques. RS worked on
both Internet Explorer 4.0 and Netscape Navigator 4.0 and older versions.
Microsoft replaced the Java applet with a Component Object Model (COM) object
named XMLHttpRequest and released most of the constraints on the
programming interface exposed by the remote URL.
ASP.NET AJAX Networking – XMLHttpRequest Object
ASP.NET AJAX Networking-XMLHttpRequest Object
Browsers generally place a new request when an HTML form is submitted
either via clientside script or through a user action such as a button click.
When the response is ready, the browser replaces the old page with the
new one
The out-of-band call is triggered via script by an HTML page event and is
served by a proxy component based on the XMLHttpRequest object
The proxy component sends a regular HTTP request and waits, either
synchronously or asynchronously, for it to be fully served. When the
response data is ready, the proxy invokes a user-defined JavaScript
callback to refresh any portion of the page that needs updating.
ASP.NET AJAX Networking – XMLHttpRequest Object
ASP.NET AJAX Networking-XMLHttpRequest Object
In Mozilla browsers XMLHttpRequest looks like a native JavaScript object and can
be instantiated through the classic new operator:
var proxy = new XMLHttpRequest();
When the browser is Internet Explorer, the XMLHttpRequest object is instantiated
using the ActiveXObject wrapper
var proxy = new ActiveXObject("Microsoft.XmlHttp");
XMLHttpRequest in Internet Explorer 7
var proxy = new XMLHttpRequest();
ASP.NET AJAX Extensions completely encapsulates this object and shields page
authors and application designers from it
ASP.NET AJAX Networking – XMLHttpRequest Object
ASP.NET AJAX Networking-XMLHttpRequest Object
The XMLHttpRequest object is designed to perform one key
operation: sending an HTTP request. The request can be
sent either synchronously or asynchronously.
interface XMLHttpRequest {
function onreadystatechange;
readonly unsigned short readyState;
void open(string method, string url);
void open(string method, string url, bool async);
void open(string method, string url, bool async, string user);
void open(string method, string url, bool async,
string user, string pswd);
void setRequestHeader(string header, string value);
void send(string data);
void send(Document data);
void abort();
string getAllResponseHeaders();
string getResponseHeader(string header);
string responseText;
Document responseXML;
unsigned short status;
string statusText;
};
ASP.NET AJAX Networking – XMLHttpRequest Object
ASP.NET AJAX Networking-XMLHttpRequest Object-Example
(Time.aspx) is a web page that returns the server time to its caller. It
takes no parameters and returns a string .
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Time Page</title>
<script runat="server">
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
Response.Write("Server Time:"+DateTime.Now.ToUniversalTime());
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
ASP.NET AJAX Networking – XMLHttpRequest Object - Example
ASP.NET AJAX Networking-XMLHttpRequest Object-Example
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Networking using XMLHttpRequestObject</title>
<script type="text/javascript">
var xmlhttp;
function pageLoad() {
if(window.ActiveXObject) {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
else {
xmlhttp = new XMLHttpRequest();
}
xmlhttp.open("GET", "Time.aspx", true);
xmlhttp.onreadystatechange = readyStateChangedHandler;
xmlhttp.send();
}
function readyStateChangedHandler() {
if(xmlhttp.readyState == 4) {
alert(xmlhttp.responseText);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server“
ID="ScriptManager1">
</asp:ScriptManager>
</form>
</body>
</html>
(CallTime.aspx) shows basic usage of the XMLHttpRequest
object to call the time web page
ASP.NET AJAX Networking – XMLHttpRequest Object - Example
ASP.NET AJAX Networking-Data Communication
An important part of any type of distributed application is how data is pushed
around between tiers or layers of the application
With AJAX, the following concepts are important
• XML—XML is Extensible Markup Language. It is primarily used for data interchange.
• XSLT—XSLT is Extensible Stylesheet Language Transformations. XSLT is designed to
take XML data from one format and put it into another format.
• JSON—JSON is the JavaScript Object Notation. JSON is a lightweight data
interchange format.
When tied together with web services, XML and JSON allow for data interchange
between different operating systems and also across the Internet.
ASP.NET AJAX Networking – Data Communications
ASP.NET AJAX Networking-Data Communication-JSON
JSON is the JavaScript Object Notation, and it is a lightweight data
interchange format.
JSON's chief advantage over XML is that the data may be parsed fairly
easily using JavaScript's built-in eval() method.
JSON is conceptually similar to arrays and collections in procedural
programming languages.
JSON is built on the following data structures:
• Name/value pairs—This may be called an object, record, structure (struct),
HashTable, keyed list, or associated array.
• List of values—This list of values is referred to an array in most
programming languages.
ASP.NET AJAX Networking – Data Communications - JSON
Web Services & JavaScript
ASP.NET 2.0 AJAX Extensions enables the call to ASP.NET Web services
from the browser by using client script. The page can call server-based
methods without a postback and without refreshing the whole page,
because only data is transferred between the browser and the Web
server.
Calling a Web service method from script is asynchronous.
To get a return value or to determine when the request has returned,
provide a succeeded callback function.
The callback function is invoked when the request has finished successfully,
and it contains the return value (if any) from the Web method call.
Provide a failed callback function to handle errors.
Web Services and JavaScript
Web Services & JavaScript-Example
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Xml;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo =
WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class ServerTime :
System.Web.Services.WebService
{
[WebMethod]
public string GetServerTime()
{
return String.Format("The server time is {0}.",
DateTime.Now);
}
}
Web Services and JavaScript - Example
Web Services & JavaScript-Example
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
body { font: 11pt Trebuchet MS;
font-color: #000000;
padding-top: 72px;
text-align: center }
.text { font: 8pt Trebuchet MS }
</style>
<title>Simple Web Service</title>
<script type="text/javascript">
// This function calls the Web Service method.
function GetServerTime()
{
ServerTime.GetServerTime(OnSucceeded);
}
// This is the callback function that
// processes the Web Service return value.
function OnSucceeded(result)
{
var RsltElem = document.getElementById("Results");
RsltElem.innerHTML = result;
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<asp:ScriptManager runat="server" ID="scriptManager">
<Services>
<asp:ServiceReference path="ServerTime.asmx" />
</Services>
</asp:ScriptManager>
<div>
<h2>Server Time</h2>
<p>Calling a service that returns the current server
time.</p>
<input id="EchoButton" type="button"
value="GetTime" onclick="GetServerTime()" />
</div>
</form>
<hr/>
<div>
<span id="Results"></span>
</div>
</body>
</html>
Web Services and JavaScript - Example
Rich AJAX ToolKit Controls
The Toolkit is a shared source project with code
contributions from developers from Microsoft and
elsewhere.
The Toolkit contains some new controls that have AJAX
functionality and a lot of control exten-ders. The control
extenders attach to another control to enhance or
“extend” the control’s functionality .
An extender is basically a server control that emits proper
script code—the client behavior—to enhance how a given
ASP.NET control behaves on the client
Rich AJAX Toolkit Controls

More Related Content

What's hot (20)

AJAX
AJAXAJAX
AJAX
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Xml http request
Xml http requestXml http request
Xml http request
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
 
Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
 
[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Spring MVC Annotations
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC Annotations
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Ajax Lecture Notes
Ajax Lecture NotesAjax Lecture Notes
Ajax Lecture Notes
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
AJAX
AJAXAJAX
AJAX
 
Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVC
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scala
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Ajax
AjaxAjax
Ajax
 

Viewers also liked

SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practicesSynapseindiappsdevelopment
 
SynapseIndia dotnet development platform overview
SynapseIndia  dotnet development platform overviewSynapseIndia  dotnet development platform overview
SynapseIndia dotnet development platform overviewSynapseindiappsdevelopment
 
Synapse india dotnet framework development or c
Synapse india dotnet framework development or cSynapse india dotnet framework development or c
Synapse india dotnet framework development or cSynapseindiappsdevelopment
 
Synapse india reviews sharing chapter 23 – asp.net
Synapse india reviews sharing  chapter 23 – asp.netSynapse india reviews sharing  chapter 23 – asp.net
Synapse india reviews sharing chapter 23 – asp.netSynapseindiappsdevelopment
 
SynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseindiappsdevelopment
 
SynapseIndia dotnet development methodologies iterative
SynapseIndia dotnet development methodologies   iterativeSynapseIndia dotnet development methodologies   iterative
SynapseIndia dotnet development methodologies iterativeSynapseindiappsdevelopment
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindiappsdevelopment
 
Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapseindiappsdevelopment
 
Synapseindia dot net development computer programming
Synapseindia dot net development  computer programmingSynapseindia dot net development  computer programming
Synapseindia dot net development computer programmingSynapseindiappsdevelopment
 
Synapseindia android apps application development
Synapseindia android apps application developmentSynapseindia android apps application development
Synapseindia android apps application developmentSynapseindiappsdevelopment
 

Viewers also liked (17)

Chapter 6 arrays part-1
Chapter 6   arrays part-1Chapter 6   arrays part-1
Chapter 6 arrays part-1
 
SynapseIndia dotnet development framework
SynapseIndia  dotnet development frameworkSynapseIndia  dotnet development framework
SynapseIndia dotnet development framework
 
Synapseindia android apps overview
Synapseindia android apps overviewSynapseindia android apps overview
Synapseindia android apps overview
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
SynapseIndia dotnet development platform overview
SynapseIndia  dotnet development platform overviewSynapseIndia  dotnet development platform overview
SynapseIndia dotnet development platform overview
 
Synapse india dotnet framework development or c
Synapse india dotnet framework development or cSynapse india dotnet framework development or c
Synapse india dotnet framework development or c
 
Synapse india reviews sharing chapter 23 – asp.net
Synapse india reviews sharing  chapter 23 – asp.netSynapse india reviews sharing  chapter 23 – asp.net
Synapse india reviews sharing chapter 23 – asp.net
 
SynapseIndia mobile apps trends, 2013
SynapseIndia mobile apps  trends, 2013SynapseIndia mobile apps  trends, 2013
SynapseIndia mobile apps trends, 2013
 
SynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architectureSynapseIndia mobile apps deployment framework architecture
SynapseIndia mobile apps deployment framework architecture
 
SynapseIndia java and .net development
SynapseIndia java and .net developmentSynapseIndia java and .net development
SynapseIndia java and .net development
 
SynapseIndia dotnet module development part 1
SynapseIndia  dotnet module development part 1SynapseIndia  dotnet module development part 1
SynapseIndia dotnet module development part 1
 
Synapseindia android apps application
Synapseindia android apps applicationSynapseindia android apps application
Synapseindia android apps application
 
SynapseIndia dotnet development methodologies iterative
SynapseIndia dotnet development methodologies   iterativeSynapseIndia dotnet development methodologies   iterative
SynapseIndia dotnet development methodologies iterative
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1
 
Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3
 
Synapseindia dot net development computer programming
Synapseindia dot net development  computer programmingSynapseindia dot net development  computer programming
Synapseindia dot net development computer programming
 
Synapseindia android apps application development
Synapseindia android apps application developmentSynapseindia android apps application development
Synapseindia android apps application development
 

Similar to SynapseIndia dotnet development ajax client library (20)

Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
SynapseIndia dotnet client library Development
SynapseIndia dotnet client library DevelopmentSynapseIndia dotnet client library Development
SynapseIndia dotnet client library Development
 
mukesh
mukeshmukesh
mukesh
 
Ajax.ppt
Ajax.pptAjax.ppt
Ajax.ppt
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohan
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
M Ramya
M RamyaM Ramya
M Ramya
 
Ajax
AjaxAjax
Ajax
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Ajax
AjaxAjax
Ajax
 
M6 l8-ajax-handout
M6 l8-ajax-handoutM6 l8-ajax-handout
M6 l8-ajax-handout
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
 
Mashup
MashupMashup
Mashup
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
 

More from Synapseindiappsdevelopment

Synapse india elance top in demand in it skills
Synapse india elance top in demand in it skillsSynapse india elance top in demand in it skills
Synapse india elance top in demand in it skillsSynapseindiappsdevelopment
 
SynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture moduleSynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture moduleSynapseindiappsdevelopment
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications developmentSynapseindiappsdevelopment
 
SynapseIndia dotnet website security development
SynapseIndia  dotnet website security developmentSynapseIndia  dotnet website security development
SynapseIndia dotnet website security developmentSynapseindiappsdevelopment
 
SynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architectureSynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architectureSynapseindiappsdevelopment
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseindiappsdevelopment
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
SynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development processSynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development processSynapseindiappsdevelopment
 
Synapse india sharing info on dotnet framework part1
Synapse india sharing info on dotnet framework part1Synapse india sharing info on dotnet framework part1
Synapse india sharing info on dotnet framework part1Synapseindiappsdevelopment
 
Synapse india sharing info on dotnet framework part2
Synapse india sharing info on dotnet framework part2Synapse india sharing info on dotnet framework part2
Synapse india sharing info on dotnet framework part2Synapseindiappsdevelopment
 
Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4Synapseindiappsdevelopment
 

More from Synapseindiappsdevelopment (20)

Synapse india elance top in demand in it skills
Synapse india elance top in demand in it skillsSynapse india elance top in demand in it skills
Synapse india elance top in demand in it skills
 
SynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture moduleSynapseIndia dotnet web development architecture module
SynapseIndia dotnet web development architecture module
 
SynapseIndia dotnet framework library
SynapseIndia  dotnet framework librarySynapseIndia  dotnet framework library
SynapseIndia dotnet framework library
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications development
 
SynapseIndia dotnet website security development
SynapseIndia  dotnet website security developmentSynapseIndia  dotnet website security development
SynapseIndia dotnet website security development
 
SynapseIndia mobile build apps management
SynapseIndia mobile build apps managementSynapseIndia mobile build apps management
SynapseIndia mobile build apps management
 
SynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architectureSynapseIndia mobile apps deployment framework internal architecture
SynapseIndia mobile apps deployment framework internal architecture
 
SynapseIndia dotnet development panel control
SynapseIndia dotnet development panel controlSynapseIndia dotnet development panel control
SynapseIndia dotnet development panel control
 
SynapseIndia php web development
SynapseIndia php web developmentSynapseIndia php web development
SynapseIndia php web development
 
SynapseIndia mobile apps architecture
SynapseIndia mobile apps architectureSynapseIndia mobile apps architecture
SynapseIndia mobile apps architecture
 
SynapseIndia mobile apps
SynapseIndia mobile appsSynapseIndia mobile apps
SynapseIndia mobile apps
 
SynapseIndia dotnet development
SynapseIndia dotnet developmentSynapseIndia dotnet development
SynapseIndia dotnet development
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically development
 
SynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax DevelopmentSynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax Development
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
SynapseIndia drupal presentation on drupal
SynapseIndia drupal  presentation on drupalSynapseIndia drupal  presentation on drupal
SynapseIndia drupal presentation on drupal
 
SynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development processSynapseIndia dotnet debugging development process
SynapseIndia dotnet debugging development process
 
Synapse india sharing info on dotnet framework part1
Synapse india sharing info on dotnet framework part1Synapse india sharing info on dotnet framework part1
Synapse india sharing info on dotnet framework part1
 
Synapse india sharing info on dotnet framework part2
Synapse india sharing info on dotnet framework part2Synapse india sharing info on dotnet framework part2
Synapse india sharing info on dotnet framework part2
 
Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4
 

Recently uploaded

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

SynapseIndia dotnet development ajax client library

  • 1. SynapseIndia DOTNET Development AJAX Client Library Type System : Class - Interface
  • 2. ASP.NET AJAX Client Library-Type System: Class-Interface Interfaces are a convenient way to define standard behaviors that other types can implement . An interface is a contract that states that the implementer of the interface must provide all of the functionality specified in the interface. The interface itself is only a specification and has no functionality of its own Interface definitions follow the same pattern as creating classes The function name is the name of the interface. The prototype of the function is modified to add the interface members. The convention in defining interface members is to throw Error.notImplemented for each member, so any class that implements the interface then needs to override the interface members to provide real implementations or the exception will be thrown. ASP.NET AJAX Client Library – Type System : Class - Interface
  • 3. ASP.NET AJAX Client Library-Type System: Class-Interface <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>ASP.NET AJAX Interface</title> <script type="text/javascript"> function pageLoad(sender, args) { Type.registerNamespace('Wrox.ASPAJAX.Samples'); Wrox.ASPAJAX.Samples.IProvideTrackInfo = function() { throw Error.notImplemented(); } Wrox.ASPAJAX.Samples.IProvideTrackInfo.prototype = { get_trackCount: function() { throw Error.notImplemented(); } } Wrox.ASPAJAX.Samples.IProvideTrackInfo.registerInterface ('Wrox.ASPAJAX.Samples.IProvideTrackInfo'); } </script> </head> <body> <form id="form1" runat="server"> <div> </div> </form> </body> </html> ASP.NET AJAX Client Library – Type System : Class - Interface
  • 4. ASP.NET AJAX Client Library-Type System: Class-Enumeration function pageLoad(sender, args) { Type.registerNamespace('Wrox.ASPAJAX.Samples'); Wrox.ASPAJAX.Samples.MusicGenre = function() { throw Error.invalidOperation(); } Wrox.ASPAJAX.Samples.MusicGenre.prototype = { Blues: 1, Classical: 2, Electronic: 3, Folk: 4, Industrial: 5, Jazz: 6, NewAge: 7, HipHop: 8, Rock: 9, WorldFusion: 10 } Wrox.ASPAJAX.Samples.MusicGenre.registerEnum ('Wrox.ASPAJAX.Samples.MusicGenre'); var genre = Wrox.ASPAJAX.Samples.MusicGenre.Industrial; alert(Wrox.ASPAJAX.Samples.MusicGenre.toString(ge nre)); alert(genre == Wrox.ASPAJAX.Samples.MusicGenre.Industrial); } The ASP.NET AJAX type system provides for defining enumerations and a specialized version of them used as combinable flags. Enums let you establish a set of possible values ASP.NET AJAX Client Library – Type System : Class – Enumeration
  • 5. ASP.NET AJAX Client Library-AJAX Base Class Library Microsoft ASP.NET AJAX provides features that helps in creating client script and integrate it into ASP.NET applications. This includes extensions to existing ECMAScript (JavaScript) objects to give them the richness of .NET Framework classes The AJAX Library takes a familiar set of features from the Base Class Library of the .NET Framework and brings it to JavaScript in the browser Extensions to JavaScript base types provide additional functionality for these types. • Array Type Extensions • Boolean Type Extensions • Date Type Extensions • Error Type Extensions • Number Type Extensions • Object Type Extensions • String Type Extensions ASP.NET AJAX Client Library – AJAX Base Class Library
  • 6. ASP.NET AJAX Networking The core of AJAX development is the ability to make asynchronous web service calls from JavaScript code. Major web browsers have included an XMLHttpRequest object for making HTTP requests. The XMLHttpRequest object is used to perform out-of-band communications with the server for invoking web services, executing callbacks, and performing partial page updates. ASP.NET AJAX provides classes for managing web requests, processing responses, and detecting errors. It also provides support for serializing objects formatted as JSON (JavaScript Object Notation), which makes them readily usable in JavaScript in the browser. • JSON is a standard serial format that is more lightweight than XML. ASP.NET AJAX Networking
  • 7. ASP.NET AJAX Networking- XMLHttpRequest Object Remote Scripting: • To minimize the impact of page redraws, primitive forms of scripted remote procedure calls (RPC) appeared around 1997. Microsoft, in particular, pioneered this field with a technology called Remote Scripting (RS). • RS employed a Java applet to pull in data from a remote Active Server Pages (ASP)- based URL. The URL exposed a contracted programming interface through a target ASP page and serialized data back and forth through plain strings. On the client, a little JavaScript framework received data and invoked a user-defined callback to update the user interface via Dynamic HTML or similar techniques. RS worked on both Internet Explorer 4.0 and Netscape Navigator 4.0 and older versions. Microsoft replaced the Java applet with a Component Object Model (COM) object named XMLHttpRequest and released most of the constraints on the programming interface exposed by the remote URL. ASP.NET AJAX Networking – XMLHttpRequest Object
  • 8. ASP.NET AJAX Networking-XMLHttpRequest Object Browsers generally place a new request when an HTML form is submitted either via clientside script or through a user action such as a button click. When the response is ready, the browser replaces the old page with the new one The out-of-band call is triggered via script by an HTML page event and is served by a proxy component based on the XMLHttpRequest object The proxy component sends a regular HTTP request and waits, either synchronously or asynchronously, for it to be fully served. When the response data is ready, the proxy invokes a user-defined JavaScript callback to refresh any portion of the page that needs updating. ASP.NET AJAX Networking – XMLHttpRequest Object
  • 9. ASP.NET AJAX Networking-XMLHttpRequest Object In Mozilla browsers XMLHttpRequest looks like a native JavaScript object and can be instantiated through the classic new operator: var proxy = new XMLHttpRequest(); When the browser is Internet Explorer, the XMLHttpRequest object is instantiated using the ActiveXObject wrapper var proxy = new ActiveXObject("Microsoft.XmlHttp"); XMLHttpRequest in Internet Explorer 7 var proxy = new XMLHttpRequest(); ASP.NET AJAX Extensions completely encapsulates this object and shields page authors and application designers from it ASP.NET AJAX Networking – XMLHttpRequest Object
  • 10. ASP.NET AJAX Networking-XMLHttpRequest Object The XMLHttpRequest object is designed to perform one key operation: sending an HTTP request. The request can be sent either synchronously or asynchronously. interface XMLHttpRequest { function onreadystatechange; readonly unsigned short readyState; void open(string method, string url); void open(string method, string url, bool async); void open(string method, string url, bool async, string user); void open(string method, string url, bool async, string user, string pswd); void setRequestHeader(string header, string value); void send(string data); void send(Document data); void abort(); string getAllResponseHeaders(); string getResponseHeader(string header); string responseText; Document responseXML; unsigned short status; string statusText; }; ASP.NET AJAX Networking – XMLHttpRequest Object
  • 11. ASP.NET AJAX Networking-XMLHttpRequest Object-Example (Time.aspx) is a web page that returns the server time to its caller. It takes no parameters and returns a string . <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Time Page</title> <script runat="server"> protected override void OnLoad(EventArgs e) { base.OnLoad(e); Response.Write("Server Time:"+DateTime.Now.ToUniversalTime()); } </script> </head> <body> <form id="form1" runat="server"> <div> </div> </form> </body> </html> ASP.NET AJAX Networking – XMLHttpRequest Object - Example
  • 12. ASP.NET AJAX Networking-XMLHttpRequest Object-Example <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Networking using XMLHttpRequestObject</title> <script type="text/javascript"> var xmlhttp; function pageLoad() { if(window.ActiveXObject) { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } else { xmlhttp = new XMLHttpRequest(); } xmlhttp.open("GET", "Time.aspx", true); xmlhttp.onreadystatechange = readyStateChangedHandler; xmlhttp.send(); } function readyStateChangedHandler() { if(xmlhttp.readyState == 4) { alert(xmlhttp.responseText); } } </script> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager runat="server“ ID="ScriptManager1"> </asp:ScriptManager> </form> </body> </html> (CallTime.aspx) shows basic usage of the XMLHttpRequest object to call the time web page ASP.NET AJAX Networking – XMLHttpRequest Object - Example
  • 13. ASP.NET AJAX Networking-Data Communication An important part of any type of distributed application is how data is pushed around between tiers or layers of the application With AJAX, the following concepts are important • XML—XML is Extensible Markup Language. It is primarily used for data interchange. • XSLT—XSLT is Extensible Stylesheet Language Transformations. XSLT is designed to take XML data from one format and put it into another format. • JSON—JSON is the JavaScript Object Notation. JSON is a lightweight data interchange format. When tied together with web services, XML and JSON allow for data interchange between different operating systems and also across the Internet. ASP.NET AJAX Networking – Data Communications
  • 14. ASP.NET AJAX Networking-Data Communication-JSON JSON is the JavaScript Object Notation, and it is a lightweight data interchange format. JSON's chief advantage over XML is that the data may be parsed fairly easily using JavaScript's built-in eval() method. JSON is conceptually similar to arrays and collections in procedural programming languages. JSON is built on the following data structures: • Name/value pairs—This may be called an object, record, structure (struct), HashTable, keyed list, or associated array. • List of values—This list of values is referred to an array in most programming languages. ASP.NET AJAX Networking – Data Communications - JSON
  • 15. Web Services & JavaScript ASP.NET 2.0 AJAX Extensions enables the call to ASP.NET Web services from the browser by using client script. The page can call server-based methods without a postback and without refreshing the whole page, because only data is transferred between the browser and the Web server. Calling a Web service method from script is asynchronous. To get a return value or to determine when the request has returned, provide a succeeded callback function. The callback function is invoked when the request has finished successfully, and it contains the return value (if any) from the Web method call. Provide a failed callback function to handle errors. Web Services and JavaScript
  • 16. Web Services & JavaScript-Example using System; using System.Web; using System.Collections; using System.Web.Services; using System.Xml; using System.Web.Services.Protocols; using System.Web.Script.Services; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] public class ServerTime : System.Web.Services.WebService { [WebMethod] public string GetServerTime() { return String.Format("The server time is {0}.", DateTime.Now); } } Web Services and JavaScript - Example
  • 17. Web Services & JavaScript-Example <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <style type="text/css"> body { font: 11pt Trebuchet MS; font-color: #000000; padding-top: 72px; text-align: center } .text { font: 8pt Trebuchet MS } </style> <title>Simple Web Service</title> <script type="text/javascript"> // This function calls the Web Service method. function GetServerTime() { ServerTime.GetServerTime(OnSucceeded); } // This is the callback function that // processes the Web Service return value. function OnSucceeded(result) { var RsltElem = document.getElementById("Results"); RsltElem.innerHTML = result; } </script> </head> <body> <form id="Form1" runat="server"> <asp:ScriptManager runat="server" ID="scriptManager"> <Services> <asp:ServiceReference path="ServerTime.asmx" /> </Services> </asp:ScriptManager> <div> <h2>Server Time</h2> <p>Calling a service that returns the current server time.</p> <input id="EchoButton" type="button" value="GetTime" onclick="GetServerTime()" /> </div> </form> <hr/> <div> <span id="Results"></span> </div> </body> </html> Web Services and JavaScript - Example
  • 18. Rich AJAX ToolKit Controls The Toolkit is a shared source project with code contributions from developers from Microsoft and elsewhere. The Toolkit contains some new controls that have AJAX functionality and a lot of control exten-ders. The control extenders attach to another control to enhance or “extend” the control’s functionality . An extender is basically a server control that emits proper script code—the client behavior—to enhance how a given ASP.NET control behaves on the client Rich AJAX Toolkit Controls