Dot Net
How do we reference HTML controls using Atlas?
Dec 7th
<input type=”button” value=”button” />
You can reference the above HTML defined button using the below code snippet of JavaScript. We have also attached the onClick method with the button. This method will be called when we click the button.
var btnVisibility = new Sys.UI.Button($(‘Button1′)); btnVisibility.initialize();
btnVisibility.click.add(onClick);
You can refer other HTML elements like Label, Textbbox m CheckBox , Hyperlinks etc using the Sys.UI.
How do we define interfaces using Atlas?
Dec 7th
Below is a numbered code snippet which will answer both the upper questions. Lets understand in detail the numbered sections.
1 and 2 — This defines the interface definition. Function.abstractMethod() defines a method as abstract.
3 – We need to register the interface which is done by using registerInterface method.
4, 5 and 6 – Inheritance and Interface is defined when we register the class. registerClass has three inputs. 4th section defines the main class which needs to be registered. 5th section defines the parent class from which it will inherit. 6th section defines the interface. So clsMyCustomCustomer is the class which derives More >
How can we create a class in JavaScript using Atlas?
Dec 7th
JavaScript is object based language and this a new feature which is provided by Atlas. Using Atlas you can now define classes, do inheritance, create interfaces etc in JavaScript. You can now implement all the object oriented concepts in JavaScript. So let’s understand the same with an example.
Once you install the Atlas setup you will get the following JS files and a web.config file as shown in the below figure. In order to use Atlas you need to add the JS files in your project. You can see from the figure below we have added the JavaScript files and the More >
How do we pass parameters to the server?
Dec 7th
Below are the two ways of passing data to server. The first one shows by using GET and the second by POST.
xmlHttpObj.open(“GET”,”http://” + location.host + “/XmlHttpExample1/ WebForm1.aspx?value=123″, true);
xmlHttpObj.open(“POST”,”http://” + location.host + “/XmlHttpExample1/ WebForm1.aspx?value=123″, true);
How can we send request to the server using the XMLHttpRequest component?
Dec 7th
abort() :- This method cancels a user request.
getAllResponseHeaders() :- Returns a collection of HTTP headers as string. If you want a specific header value you can use getResponseHeader(“headername”)
open(“method”,“URL”, “async”, “uname”,“pswd”) :- This method takes a URL and other values needed for a request. You can also specify how the request is sent by GET, POST or PUT. One of the important values is how this request will be sent asynchronously or synchronously. true means that processing is carried after the send () method, without waiting for a response. false means that processing is waits for a response before continuing.
send (content):- More >
How do we do asynchronous processing using Ajax?
Dec 7th
xmlHttpObj.onreadystatechange = function1();
Above is the code snippet which will help us to do asynchronous processing. So function1() will be called when the XMLHTTP request object goes to on ready state change.
How do we use XMLHttpRequest object in JavaScript?
Dec 7th
Below is a code snippet which shows how to use XMLHttpRequest object. In this code snippet we are sending a GET request on the local IIS. Below is the explanation of the code snippet according to the numbers specified in the code snippet.
1,2,3,4 – This is like checking which is this browser and create the objects accordingly. XMLHttpRequest objects have different ways of technical implementation according to different browsers. In Internet explorer it’s an activex object but in other browsers its XMLHttpRequest. So if windows.XMLHttpRequest does not return null then we can create XMLHttpRequest object. If it returns null then More >
What is JSON?
Dec 7th
JSON is a very lightweight data format based on a subset of the JavaScript syntax, namely array and object literals. JSON allows communicating with server in a standard way. JSON is used as communication notation instead of XML.
var oBike =
{
“color” : “Green”, “Speed”: 200, };
alert(oBike.color); //outputs “Green”
alert(oBike.Speed); //outputs 200
The above code creates an object bike with two properties Color and Speed.
What is the basic fundamental behind Ajax?
Dec 7th
XmlHttpRequest is the basic fundamental behind Ajax. This allows the browser to communicate to a back end server asynchronously.XmlHttpRequest object allows the browser to communicate with server with out making post backs.
What is Ajax?
Dec 7th
Ajax is a set of client side technologies that provides asynchronous communication between user interfaces and web server. So the advantages of using Ajax are asynchronous communication, minimal data transfer and server is not overloaded with unnecessary load.