protected void btnAdd_Click(object sender, EventArgs e) { if (txtName.Text.Trim().Equals("")) { ClientScript.RegisterStartupScript(GetType(), "err", "alert('请输入分类名称');", true); return; } JavaDLL dll = new JavaDLL(); if (dll.addCategory(txtName.Text.Trim(), txtValues.Text.Trim())) { ClientScript.RegisterStartupScript(GetType(), "err", "top.closeDialog()", true); } else { ClientScript.RegisterStartupScript(GetType(), "err", "alert('添加失败!');", true); } }