Please Help me i am getting this error whenever i am selecting any data from drodown lisy
[WebMethod]
public static List<ListItem> GetClassgrp()
{
string query = "select CODE,DESC_E from S_CLASS_GRP Order By 1";
string connectionstring = ConfigurationManager.ConnectionStrings["constrIND"].ConnectionString;
using (OracleConnection con = new OracleConnection(connectionstring))
{
using (OracleCommand cmd = new OracleCommand(query))
{
List<ListItem> classgrp = new List<ListItem>();
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
using (OracleDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read())
{
classgrp.Add(new ListItem
{
Value = sdr["CODE"].ToString(),
Text = sdr["DESC_E"].ToString()
});
}
}
con.Close();
return classgrp;
}
}
}
$.ajax({
type: "POST",
url: "DropDwonPopulate.aspx/GetClassgrp",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
var ddlCLG = $("[id*=ddlCLG]");
ddlCLG.empty().append('<option selected="selected" value="%">All</option>');
$.each(r.d, function () {
ddlCLG.append($("<option></option>").val(this['Value']).html(this['Text']));
});
}
});