How to get values out of Ajax success data function

How to get values out of Ajax success data function

My Ajax data function has data but I can't figure out how to get that data out and insert it into a textbox with the ID of FirstName. I know the data is there because I can debug and see "d" contains all of the data from my query but how do I extract it from the success function?

My Ajax data function has data but I can't figure out how to get that data out and insert it into a textbox with the ID of FirstName. I know the data is there because I can debug and see "d" contains all of the data from my query but how do I extract it from the success function?

$(document).ready(function () {
$("#btnGetData").click(function () {        
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "Default.aspx/GetFormData", //Default.aspx is page and GetFormData is the WebMethod  
        data: {},
        dataType: "json",
        success: function (data) {
            data: { ("#FirstName").val(d.FirstName) }            
        },            
        error: function () {
            alert("Error while Showing update data");
        }
    });
});
});

WebMethod:

public static List<MembersClass> GetFormData()
{

List&lt;MembersClass&gt; infoObjs = new List&lt;MembersClass&gt;();
try
{
    // Initialization.
    string cs = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

    using (SqlConnection con = new SqlConnection(cs))
    {
        SqlCommand cmd = new SqlCommand("dbo.spGetMemberbyMemberID", con);
        cmd.Parameters.AddWithValue("@MemberID", "123");
        cmd.CommandType = CommandType.StoredProcedure;
        con.Open();
        SqlDataReader rdr = cmd.ExecuteReader();

        // Read file.
        while (rdr.Read())
        {
            MembersClass infoObj = new MembersClass();
            infoObj.FirstName = rdr["first_name"].ToString();
            infoObj.LastName = rdr["last_name"].ToString();

            // Adding.
            infoObjs.Add(infoObj);

        }
    }
}
catch (Exception ex)
{
    Console.Write(ex);
}

// info.
return infoObjs;

}


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

ASP.NET MVC Application with JQuery, AJAX

Let's have a sample example: We have a submit button in our JQuery AJAX MVC application. Let's try to show a message when it is clicked. ASP.NET MVC Application - Using JQuery, AJAX

Add asp.net Identity in empty project

LIKE | COMMENT | SHARE | SUBSCRIBE Today, in this tutorial you will see the process of adding an ASP.NET Identity to the ASP.NET Web Application developed in...

List all users from asp net core identity

LIKE | COMMENT | SHARE | SUBSCRIBE In this video, i will show you How to retrieve and display all the registered application users in asp.net core using the ...