コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List <Dept> listde = dm.GetAllDept();

        Response.ContentType = "text/json;charset=utf-8";
        string json = CheckKeys.GetData(Request.Headers["kl"], listde);

        Response.Write(json);
        Response.End();
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                List <Emps> listem = em.GetAllEmps();
                gv_emps.DataSource = listem;
                gv_emps.DataBind();

                List <Dept> listde = ds.GetAllDept();
                ddl_dept.DataSource     = listde;
                ddl_dept.DataTextField  = "dname";
                ddl_dept.DataValueField = "deptno";
                ddl_dept.DataBind();
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }