how to pass parameter from url to behind code

how to pass parameter from url to behind code

Hi..
I have a function behind code that generate xml from database query.. 
I use jqxgrid to display a table.. and the data displayed was chosen by user from a dropdownlist..
I have problem on passsing the parameter..
Appreciate if someone can advice me.. THanks..

  1. $(document).ready(function () {
  2.             var e = document.getElementById("MainContent_ddlType");
  3.             var selectedT = e.options[e.selectedIndex].text;
  4.  ;
  5.            
  6.             source = {
  7.                 datatype: "xml",
  8.                 datafields: [
  9.                     { name: 'ID' },
  10.                     { name: 'TYPE' },
  11.                     { name: 'STATUS' },
  12.                     { name: 'ROOT_CAUSE' },
  13.                     { name: 'CREATION_DATE' }
  14.                 ],
  15.                 type: "POST",
  16.                 url: 'Index.aspx/GetDetails',
  17.                 data: JSON.stringify({selectedType: selectedT}),
  18.                 async: false,
  19.                 record: 'Table',
  20.             };
  21.   var dataAdapter = new $.jqx.dataAdapter(source,
  22.                     { contentType: 'application/json; charset=utf-8' }
  23.                 );
  24.             //alert(dataAdapter.);

  25.             $("#jqxgrid").jqxGrid(
  26.             {
  27.                 width: 600,
  28.                 height: 450,
  29.                 source: dataAdapter,
  30.                 theme: 'classic',
  31.                 sortable: true,
  32.                 pageable: true,
  33.                 columns: [
  34.                   { text: 'ID', datafield: 'ID', width: 250 },
  35.                   { text: 'Type', datafield: 'TYPE', width: 150 },
  36.                   { text: 'Status', datafield: 'STATUS', width: 150 },
  37.                   { text: 'Root Cause', datafield: 'ROOT_CAUSE', width: 180, cellsalign: 'right' },
  38.                   { text: 'Creation Date', datafield: 'CREATION_DATE', width: 100, cellsalign: 'right', cellsformat: 'c2' }
  39.                 ]
  40.             });
  41.         });

code behind:
  1.         [WebMethod]
  2.         [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
  3.         public static string GetExceptionDetails(string selectedType)
  4.         {
  5.             string selectString = "SELECT * FROM table_details where type= '" + selectedType + "'";
  6.             oledb.OleDbCommand cmd = new oledb.OleDbCommand(selectString);

  7.             //populate the DataSet
  8.             DataSet data = GetData(cmd);

  9.             //return the tables as XML
  10.             System.IO.StringWriter writer = new System.IO.StringWriter();
  11.             data.Tables[0].WriteXml(writer, XmlWriteMode.WriteSchema, false);
  12.             return writer.ToString();
  13.         }