Wednesday, July 22, 2009
Easy steps to develop application using Ajax.NET Pro Library
Thursday, July 16, 2009
Google vs. Microsoft: What you need to know
http://edition.cnn.com/2009/TECH/07/15/google.microsoft.battle/index.html
Wednesday, July 1, 2009
AJAX.NET Professional Library Example
AJAX.Net Professional Library
JavaScript Prototype Framework 1.6.0.3 (updated version)
Monday, June 22, 2009
AJAX.NET Professional Library setup quick guide
Saturday, June 20, 2009
Advanced Javascript: Objects, Arrays, and Array-Like objects
Earlier in this tutorial we have seen that JavaScript has several built-in objects, like String, Date, Array, and more. In addition to these built-in objects, you can also create your own.An object is just a special kind of data, with a collection of properties and methods.Let's illustrate with an example: A person is an object. Properties are the values associated with the object. The persons' properties include name, height, weight, age, skin tone, eye color, etc. All persons have these properties, but the values of those properties will differ from person to person. Objects also have methods. Methods are the actions that can be performed on objects. The persons' methods could be eat(), sleep(), work(), play(), etc.
http://nfriedly.com/techblog/2009/06/advanced-javascript-objects-arrays-and-array-like-objects/
Monday, June 8, 2009
Asynchronous client script callbacks trip Overview
- StartAsyncCall is a JavaScript function in Serverside
- OnServerCallComplete is a JavaScript function in client side.
- GetCallbackResult and RaiseCallbackEvent methods are the members for ICallbackEventHandler Interface.
Sunday, June 7, 2009
Asynchronous client script callbacks
Wednesday, June 3, 2009
What is RSS?
Before you start subscribing to the RSS feeds of your favorite sites you will need to have an RSS reader. Below you will find a list of web-based and free RSS readers that you can use:
Google Reader
Bloglines
Newsgator
Once you have your RSS reader working you can just head to your favorite website and subscribe by clicking on the RSS icon. Notice that most recent web browsers already identify RSS feeds, so you will be able to see the RSS icon (
) both on the Navigation Bar of your browser and on the page itself, as the screenshot below illustrates.

Now you are ready to start using RSS feeds from all over the Internet! If you want to know more about it just check the Wikipedia entry for RSS.
Monday, June 1, 2009
How can we access Web Service?
HTTP Handlers Overview
Document Object Model (DOM) Overview
The Document Object Model offers two levels of interface implementation: DOM Core, which supports XML and is the base for the next level, and DOM HTML, which extends the model to HTML documents. Here are some highlights:
- Any HTML or XML element (with the possibility of a few exceptions) will be individually addressable by programming.
- The specification will be language-independent. The specification, when available, will be described using the interface definition language (IDL) from the industry open standard CORBA.
- In addition, the interface will be described in terms of the Javaprogramming language and ECMAScript, an industry-standard scriptlanguage based on JavaScript and JScript.
- DOM is not to be confused with Microsoft's Component Object Model(COM) or Distributed Component Object Model (DCOM). COM and CORBA are language-independent ways to specifiy objects and could be used to create DOM objects (documents) just as specific languages like Java could.
Progress of the Document Object Model specification can be followed at the W3C Web site.
Overview:
To manipulate an XML document you first load it into your computer's memory using an XML parser. As stated above, the parser discussed here it the Msxml parser from Microsoft. Once the XML document is loaded, its data can be manipulated using a DOM.
A DOM treats the XML document as a tree. The DocumentElement is the top or root of the tree. This root element can have one or more child nodes which represent the branches of the tree.
The four main objects exposed by a DOM are the DOMDocument, XMLDOMNode, XMLDOMNodeList and XMLDOMNamedNodeMap which are all discussed below in subsequent sections.
For most XML documents, the most common types of nodes are element, attribute, and text. Attributes differ from the other node types because they are not considered child nodes of a parent. A separate programming interface, the XMLDOMNamedNodeMap, is used for attributes.
Creating a DOM:
Using the XML DOM begins when you create a DOMDocument object. You can then load, parse, navigate, and manipulate XML files. The VB code to create a DOMDocument is:
Dim xmlDoc = New DOMDocument |
Loading and Saving Data:
Use the Load or LoadXML methods to load an XML file into the DOM. The load method uses a path or url to an XML file. The loadXML method loads a string containing the XML data. After loading, XMLDoc, contains a tree consisting of the parsed contents of reports.xml.
xmlLDoc.load("http://xmlfiles/reports.xml") |
To save a parsed XML document to a file use the Save method. Save can take a file name as a string.
xmlDoc.save("c:\temp\reports.xml") |
File loading and parsing is done asynchronously by default. This means your app is free to do other work while the file is being loaded. Also by default, any well formed XML document can be loaded.
You can change this behavior by setting a few properties. Here, the XML is loaded synchronously, and validated against a DTD. Also, any external references in the DTD are resloved.
xmlDoc.async = False |
Accessing Document and Error Information:
You can retrieve the DTD used by the XML document, the path or URL of the file that was loaded and a string containing the entire contents of the XML document.
You can also get detailed information on errors that occurred during parsing.
Dim mydoctype as IXMLDOMDocumentType |
Here is some more error information that is available:
Error Property | Description |
errorCode | Error code of the last parse error |
filepos | absolute file position of the error |
line | line the error occurred on |
linepos | position with in the line |
reason | error description |
srcText | line of XML that contains the error |
You can access the tree starting at the root and walking down the tree or by querying for a specific node. You navigate to the root element using the documentElement property which returns the root element as an XMLDOMNode object.
Dim xmlDoc As New DOMDocument |
To navigate to a specific node in the tree use the getElementsByTagName method. This method takes a string containing a specific tag name and returns all element nodes with this tag name.
Dim ElemList As IXMLDOMNodeList |
The DOMDocument object provides a generic createNode method that lets you create nodes by supplying a node type, name, and namespaceURI. I say generic because it also provides individual methods to create most of the following specific node types.
Node Type | Value | Description |
Node_Element | 1 | Node is an Element |
Node_Attribute | 2 | Node is an Attritute of an element |
Node_Text | 3 | Node represents the text content of a tag |
Node_Cdata_Section | 4 | A CDATA section in the XML source. CDATA sections escape text that would otherwise be interpreted as markup. |
Node_Entity_Reference | 5 | A reference to an entity in the XML document |
Node_Entity | 6 | Node represents an expanded entity |
Node_Processing_Instruction | 7 | A processing instruction from the XML document |
Node_Comment | 8 | Node represents a comment in the XML document |
Node_Document | 9 | Represents a document object, which, as the root of the document tree, provides access to the entire XML document |
Node_Document_Type | 10 | Represents the document type declaration (DTD, indicated by the tag |
Node_Document_Fragment | 11 | A document fragment node associates a node or subtree with a document without actually being contained within the document |
Node_Notation | 12 | Represents a notation in the document type declaration (DTD) |
Here's an example of creating an attribute node:
Dim xmlDoc As New DomDocument |
XMLDOMNode |
The XMLDOMNode object is the main object within a DOM. The DOMDocument object is itself an XMLDOMNode. So are the members of node lists and named node maps which are discussed later.
Accessing Node Information
The XMLDOMNode object has several properties which provide info about a node. Here are the simpler ones:
Node Property | Description |
hasChildNodes | True if this node has children |
namespaceURI | Returns the URI (universal resource identifier) for the namespace (the "uuu" portion of the namespace declaration xmlns:nnn="uuu"). |
parsed | True if the node and all descendants have been parsed and instantiated. |
xml | Returns a string containing the XML representation of the node and all its descendants. |
nodename | Returns the qualified name for the element, attribute, or entity reference. Ex: returns xxx:yyy for the element |
nodetype | Returns an integer representing the XML DOM node type. |
nodetypestring | Returns a string representing the XML DOM node type. |
specified | Returns True if the attribute is explicitly specified in the element. Returns False if the attribute value comes from the DTD or schema. Returns True on non-attribute nodes. |
This example illustrates a few of the above properties. It checks if the root node has children and prints the number of child nodes.
Dim xmlDoc As New DOMDocument |
The data in an XML file is exposed in the DOM as node values. Node values might be the value of an attribute or the text within an XML element.
The nodeValue property provides access to values of attributes, text nodes, comments, processing instructions, and CDATA section nodes.
To get the value of an element type node, you can navigate to its element's children (the text nodes within) and call nodeValue on them or use the text property.
This code sets the value of an attribute and an element.
newAttNode = xmlDoc.createAttribute("newAtt") |
From the XMLDOMNode object, you can navigate to its: parent node using the (parentNode)method, children (childNodes, firstChild, lastChild), siblings (previousSibling, nextSibling), or the document object the node belongs (ownerDocument) to.
If the node type is element, attribute, or entityReference, you can call the definition property to navigate to the schema definition of the node.
If the node type is element, processingInstruction, documentType, entity, or notation, you can navigate to the attributes on the node using the attributes property.
These methods return the indicated node or null if the node doesn't exists.
This example illustrates how to navigate the DOM tree.
You can also navigate to other nodes in the tree using the selectNodes and selectSingleNodemethods. These methods take an XSL Pattern as an argument and return the node or nodes that match that query. For more information about XSL Patterns, see my XSL Tutorial.
Manipulating the Children of a Node:
There are four methods that let you manipulate the children of a node. Each one takes a node object as an argument. They are: appendChild, replaceChild, removeChild and insertBefore.
Dim xmlDoc As New DOMDocument |
XMLDOMNodeList |
The XMLDOMNodeList object is a collection of nodes. It is returned by the childNodes,selectNodes and getElementsByTagName methods.
You can iterate sequentially through the nodes in the list as shown in this previous example or by using the nextNode method shown below. The length property indicates the number of nodes in the list.
Dim xmlDoc As New DOMDocument |
To access nodes randomly, use the item property. This allows you to navigate directly to a specific node. The first node has an index of zero.
Dim xmlDoc As New DOMDocument |
XMLDOMNamedNodeMap |
An XMLDOMNamedNodeMap object is returned by the attributes property. The XMLDOMNamedNodeMap object differs from the node list because it is a collection of nodes that can also be accessed by name.
Just like a node list, a named node map has a length property and can be accessed using itsitem method. It also exposes the nextNode property
However, you can also access the members of a named node map name by usinggetNamedItem and getQualifiedItem. The getNamedItem method takes the name of the desired node as a parameter; the getQualifiedItem method takes the name and namespaceURI of the desired node. Each method returns an node object.
This code gets the value of the ID attribute on the elem1 element and assigns that value to the variable "idValue".
idValue = elem1.attributes.getNamedItem("ID").nodeValue |
Manipulating a Named Node Map:
These methods allow you to manipulate named node maps: setNamedItem, removeNamedItemand removeQualifiedItem.
The setNamedItem method takes an XML node object as a parameter, adding that node to the named node map. If an attribute already exists with the same name, the old attribute is replaced. This example creates a new attribute node with the name "ID" and adds it to the attributes of elem1:
idAtt = XMLDoc.createAttribute("ID") elem1.setNamedItem(idAtt) |
The removeNamedItem method takes a node name as a parameter, removing the node with that name. The removeQualifiedItem method takes a node name and namespaceURI as its parameters, removing the corresponding attribute.