10.02.2014 Views

Beginning Ajax With ASP.NET (2006).pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9<br />

Figure 9-15<br />

Try It Out<br />

Using Client Functions<br />

Begin by adding a new web form to the solution, naming it ClientFunctions.aspx. Now add the<br />

Anthem register directive to the page just under the directive:<br />

<br />

Next, add the following code within the tag:<br />

<br />

function btnTest_PreCallBack()<br />

{<br />

alert(“This happens before contacting the server”);<br />

}<br />

function btnTest_PostCallBack()<br />

{<br />

alert(“This happens after getting a “ +<br />

“response from the server”);<br />

}<br />

function btnTest_Click(control)<br />

{<br />

alert(“This happens right after you click the ‘“ +<br />

238

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!