API
HI I WANT TO FETCH CITY,STATE AND COUNTRY AUTOMATICALLY WHEN USER ENTERS PINCODE INTO TEXTBOX AND ALL THE TEXTBOXE'S OF RESPECTIVE CITY,STATE,COUNTRY SHOULD BE FILLED HOW CAN I DO IT...PLEASE GIVE SOME EXAMPLE TO IT AND I WANT IT IN WEBFORM AND NOT MVC...THANK YOU!
Anjali CPosted Mar 20, 2015, 10:42 AM
Pradeep ShetPosted Mar 20, 2015, 3:26 AM
Anjali CPosted Mar 20, 2015, 1:12 AM
Thank You!
Pradeep ShetPosted Mar 19, 2015, 4:41 PM
Follow the steps as mentioned -
1) Create a webservice or webapi which will accept pincode as input and return class which will have 3 properties City, State, Country.
2)On blur event of Pincode textbox call javascript function eg- FillAddress();
3) In this function, make a jquery ajax i.e- $.ajax(url,data) call to webservice which you have already created.
4)On success method of $.ajax, you will get the response. Set the appropriate property to City/State/Country textbox.
Hope this helps you. Do let me know in case you stuck anywhere. You will get lots of stuff about writing webservice / $.ajax() in google.