passing multiple parameters to .asmx from jquery ajax GET
<p>html</p>

<pre><code>&lt;a onclick="testGetParametersDynamic2();"&gt;fill in names and check it out&lt;/a&gt;
&lt;br /&gt;
&lt;p&gt;Enter First Name&lt;/p&gt;
&lt;input id="myFirstName" type="text" /&gt;
&lt;br /&gt;
&lt;p&gt;Enter Last Name&lt;/p&gt;
&lt;input id="myLastName" type="text" /&gt;
&lt;div id="outputGET3"&gt;&lt;/div&gt;
</code></pre>

<p>c#</p>

<pre><code>[WebMethod(EnableSession = true)]
[ScriptMethod(UseHttpGet = true)]
public string testGetParametersDynamic(string firstName, string lastName)
{
    string fullName = firstName + lastName;

    return fullName;
}
</code></pre>

<p>I have tried multiple ways of entering data bc I think this is where the problem lies</p>

<p>attempt 1 </p>

<pre><code>function testGetParametersDynamic2()
    {
        $.ajax(
        {
            post: 'GET',
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            data: '{"firstName":"' + $('#myFirstName').val() + '","lastName":' +
                    $('#myLastName').val() + '"}',
            url: 'UtilitieService.asmx/TestGetParametersDynamic',
            success: function (result)
            {
                var test = result.d;
                var outputDiv = $('outputGET3');
                outputDiv.html(test);
            },

            error: function ()
            {
                alert('Fail Test Get Dynamic');
            }
        });
    }
</code></pre>

<p>attempt 2:</p>

<pre><code>function testGetParametersDynamic2()
    {
        $.ajax(
        {
            post: 'GET',
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            data: "firstName" + $('myFirstName').val() + "&amp;lastName" + $('myLastName').val(),
            url: 'UtilitieService.asmx/TestGetParametersDynamic',
            success: function (result)
            {
                var test = result.d;
                var outputDiv = $('outputGET3');
                outputDiv.html(test);
            },

            error: function ()
            {
                alert('Fail Test Get Dynamic');
            }
        });
    }
</code></pre>

<p>both times I get this error:</p>

<p>Invalid web service call, missing value for parameter: \u0027firstName\u0027</p>
