title: How To Pass a MultiDimensional Array from Javascript to server using PageMethods in ASP.Net
body: <p>I have some <code>&lt;li&gt;</code> Items in my HTML Page like this</p>
  
  <pre><code>&lt;li id="A1" class="ui-state-default"&gt;Item 2&lt;/li&gt;
    &lt;li id="A2" class="ui-state-default"&gt;Item 3&lt;/li&gt;
    &lt;li id="A3" class="ui-state-default"&gt;Item 4&lt;/li&gt;
    &lt;li id="A4" class="ui-state-default"&gt;Item 5&lt;/li&gt;
  </code></pre>
  
  <p>I called It using Javascript and Jquery like this to get the Id and Index of the <code>&lt;li&gt;</code> elements</p>
  
  <pre><code>function LiOrder() {
              var order = $('li').map(function (i) {
                  return { id: this.id, index: i };
              }).get();
  
              PageMethods.GetServerResponse(order, OnSuccess, OnFail);
          }
  
          function OnSuccess(arg) {
              alert(arg);
          }
  </code></pre>
  
  <p>WebMethod Written in Aspx.cs Page is this</p>
  
  <pre><code>[WebMethod]
      public static string GetServerResponse(string[,] LiOrder)
      {
  
  
          return LiOrder[0,0];
      }
  </code></pre>
  
  <p>But when I try to execute it I get Error like this in Google Chrome (Javascript Console)</p>
  
  <pre><code>POST http://localhost:2453/ERP29.1.13/Production/LifeCycleRegistration.aspx/GetServerResponse 500 (Internal Server Error) ScriptResource.axd:6979
  </code></pre>
  
  <p>What might be the reason for this error. I could pass a string to WebMethod like this. But when it comes to Array, its like this. Please Help me to resolve this</p>