protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet ds = new DataAccess.Para_JobType().GetList("JobTypeParent is NULL"); foreach (DataRow dr in ds.Tables[0].Rows) { jobSelect.Items.Add(new ListItem(dr["JobName"].ToString(), dr["JobTypeID"].ToString())); } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string jobType = context.Request.Form["jobType"]; DataTable dt = new DataAccess.Para_JobType().GetList("JobTypeParent='" + jobType + "'").Tables[0]; dt.TableName = "business"; DataSet ds = new DataSet(); ds.Tables.Add(dt.Copy()); string json = JsonConvert.SerializeObject(ds); context.Response.Write(json); }