Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [WebMethod]
- public DataTable GetName()
- {
- DataTable dt = new DataTable();
- dt.Columns.Add("Name", typeof(string));
- dt.Columns.Add("CodeNo", typeof(string));
- dt.Rows.Add("Delhi","D01");
- dt.Rows.Add("Noida", "N01");
- return dt;
- }
- $(document).ready(function () {
- $().ready(function () {
- $.ajax({
- type: "POST",
- url: "Home.aspx/GetName",
- data: "{}",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (msg) {
- $("#City").get(0).options.length = 0;
- $("#City").get(0).options[0] = new Option("--Select--", "-1");
- ?.......Here ....................?
- });
- },
- error: function () {
- alert("Failed to load ");
- }
- });
- });
- -Select--
- Delhi
- Noida
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement