Organizational Research By

Surprising Reserch Topic

what does d in json mean


what does d in json mean  using -'asp.net,jquery,ajax,json'

I have a .NET webmethod that I have called from jQuery.  The method returns some HTML markup that I display within a DIV element.

Once I have the response I use

$("#div").html(result.d);


My question is, what does the .d do? I don't like using code I don't fully understand?  Could I get the same result using Eval?
    
asked Oct 19, 2015 by sumit_jaiswalmca
0 votes
1 view



Related Hot Questions



Government Jobs Opening

C# Code Here:

public partial class Contact : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList();
            }
            int[] arr1 = new int[] { 1, 2 };
            ListBox1.SelectedValue = "1";
            ListBox1.SelectedValue = "4";


        }

        void BindList()
        {

            List lst = new List()
            {
                new Product{Id=1,Name="Photo"},
                new Product{Id=2,Name="Photo"},
                new Product{Id=3,Name="Photo"},
                new Product{Id=4,Name="Photo"}
            };
            ListBox1.DataSource = lst;
            ListBox1.DataTextField = "Name";
            ListBox1.DataValueField = "Id";
            ListBox1.DataBind();
        }


        [WebMethod]
        public static string GetProducts()
        {
            // instantiate a serializer
            JavaScriptSerializer TheSerializer = new JavaScriptSerializer();

            //optional: you can create your own custom converter
           // TheSerializer.RegisterConverters(new JavaScriptConverter[] { new MyCustomJson() });

            //var products = context.GetProducts().ToList();
            Product products = new Product() { Id = 1, Name = "Testing Services" };
            var TheJson = TheSerializer.Serialize(products);

            return TheJson;
        }

    }
answered Oct 19, 2015 by nimisha.jagtap
0 votes

Its is very clear that $("#div").html(result.d); in your code

"result" is a object and d is property of "result".

Let explain,

if you create object like this,

var result{"id": "number", "d": "day"};

if we access the property of result is that using jquery

$("#div").html(result.d);

so we get result in html is

day
answered Oct 19, 2015 by gauravsinghal83

...