Ok I've figured out the solution to my problem by using version
6.6.7.1. the code is below.

JavaScript code
function BuildDataSet()
            {
                var ds = new Ajax.Web.DataSet();
            var dt = new Ajax.Web.DataTable();

            var txtValue3 = document.getElementById("TextBox3");
            var txtValue4 = document.getElementById("TextBox4");
            var txtValue5 = document.getElementById("TextBox5");
            var txtValue6 = document.getElementById("TextBox6");
            var txtValue7 = document.getElementById("TextBox7");
            var txtValue8 = document.getElementById("TextBox8");

            var StrTest1 = txtValue3.value;
            var StrTest2 = txtValue4.value;
            var StrTest3 = txtValue5.value;
            var StrTest4 = txtValue6.value;
            var StrTest5 = txtValue7.value;
            var StrTest6 = txtValue8.value;

            //Build column names
            dt.addColumn("Test1", "System.String");
            dt.addColumn("Test2", "System.String");
            dt.addColumn("Test3", "System.String");
            dt.addColumn("Test4", "System.String");
            dt.addColumn("Test5", "System.String");
            dt.addColumn("Test6", "System.String");

            // Build table row

dt.addRow({"Test1":StrTest1,"Test2":StrTest2,"Test3":StrTest3,

"Test4":StrTest4,"Test5":StrTest5,"Test6":StrTest6});

            ds.addTable(dt);

                TestFolder3_Default2.BuildInfo(ds,GetDataInfo_CallBack);
       }

C# code

[AjaxPro.AjaxMethod()]
      public string BuildInfo(AjaxPro.JavaScriptObject DataSetInfo)
      {
          return GetDataGridInfo2(DataSetInfo);
      }


public string GetDataGridInfo2(AjaxPro.JavaScriptObject DataSetInfo)
      {
          string StrTest1 = null;
          string StrTest2 = null;
          string StrTest3 = null;
          string StrTest4 = null;
          string StrTest5 = null;
          string StrTest6 = null;

          string StrBuildDataGrid = "The value from the JavaScript
Table is";
          AjaxPro.DataSetConverter oConverter = new
axPro.DataSetConverter();
          try
          {
              // object sent from client is deserializaed here
              object oWrapper = oConverter.Deserialize(DataSetInfo,
Type.GetType("System.Data.DataSet"));
              //object is correctly casted to the DataSet type
              DataSet oDS = (DataSet)oWrapper;
              foreach (DataRow NewDataRow in oDS.Tables[0].Rows)
              {
                 StrTest1 = NewDataRow["Test1"].ToString();
                 StrTest2 = NewDataRow["Test2"].ToString();
                 StrTest3 = NewDataRow["Test3"].ToString();
                 StrTest4 = NewDataRow["Test4"].ToString();
                 StrTest5 = NewDataRow["Test5"].ToString();
                 StrTest6 = NewDataRow["Test6"].ToString();
              }
              StrBuildDataGrid = StrBuildDataGrid + StrTest1 + "  " +
                                 StrTest2 + "  " + StrTest3 + "  " +
                                 StrTest4 + "  " +StrTest5 + "  " +
                                 StrTest6 + "  ";
          }
          catch (Exception ex)
               {
                 Response.Write("The error is " + ex.ToString());
                 Response.Write("<BR>");
               }
         
          return StrBuildDataGrid;
      }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to