Get Beginning Ajax with ASP .NET PDF

Functions and Syntax Previous examples have shown the use of JavaScript that executes as the page loads, as it is encountered or parsed. However, you can also define functions to encapsulate blocks of functionality.

The confirm method is used to invoke a confirmation dialog box like this: if (confirm(“This is a confirmation box”)) alert(“You clicked OK”); else alert(“You clicked cancel”); This produces the traditional OK/Cancel dialog box, as you’ll see later in the chapter. The confirm method returns a value of true if the user clicks the OK button, and false if the user clicks the Cancel button. The prompt dialog box is invoked by using the prompt method of the window object. So, suppose you would like to ask the user what his or her name is and then present that as text in the page.

Quite often you want script executed in response to events such as a user clicking a particular screen element or a mouse movement. ) This activity is usually done by referencing either inline JavaScript or a function using an XHTML attribute.

Download PDF sample

Beginning Ajax with ASP .NET by Wallace B. McClure


by Jason
4.4

Rated 4.91 of 5 – based on 49 votes