Ajax for Dummies with Asp.Net.
Ajax for Dummies with JQuery.
Couple of weeks ago a friend of mine went to a job interview for a junior developer position. After the interview he came back and complained about his Ajax skills.
Well, Noam, this is for you:
First open a new ASP.Net web application (or website, doesn't really matter).
Make sure you have JQuery in your website.
Create a new ASPX page. lets call it, WebMethods.aspx
At the top of the page add "using System.Web.Services;"
Create a method called "AjaxForDummies()" and place a "[WebMethod]" attribute for it. This method will not accept parameters but will return a string to the server.
Create another method called "AjaxForDummies2(string name, string sDate) "
this method will accept 2 parameters and returns a string to the server.
At the HTML part of the page place a simple code:
1. Always make sure your root on the properties.
2. Method should be static.
3. creating methods with the same name (overloading) is problematic.
CTO @ ITweetLive.com