52,797
社区成员
发帖
与我相关
我的任务
分享
public void get_bangding()
{
//审核人
string shr=Session["用户ID"].ToString();
fdataset fdt = new fdataset();
string sql = "select * from aaa";
DataSet set = fdt.ReturnDataset(sql);
DataTable tb = set.Tables[0];
this.RepeaterTr.DataSource = tb;
this.RepeaterTr.DataBind();
}
<asp:Repeater ID="RepeaterTr" runat="server"
onitemdatabound="RepeaterTr_ItemDataBound">
<ItemTemplate>
<tr >
<td >
<%# DataBinder.Eval(Container.DataItem, "调班人")%>
</td>
<td>
<span onclick="tijiao('ty',<%# DataBinder.Eval(Container.DataItem, "id")%>)">
同意
</span>
</td>
</tr>
<ItemTemplate>
</ItemTemplate>
function tijiao(cz_type,id) {
Selectgetxmlxr();
if (cz_type == "ty") {
url = "aaa.ashx?type=ty&id=" + id;
}
xmlHttp.open("POST", url, false);
xmlHttp.onreadystatechange = fanhuizhi;
xmlHttp.send(null);
}
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string type = context.Request.QueryString["type"].ToString();
string id = context.Request.QueryString["id"].ToString();
if (type == "ty")
{
//执行修改
context.Response.Write("ok");
}
else
{
context.Response.Write("no");
}
}
<span onclick="tijiao('ty',<%# DataBinder.Eval(Container.DataItem, "id")%>,this)">
function fanhuizhi(span){
//.....其他代码
span.parentNode.innerHTML='已经同意';
}
function tijiao(cz_type,id,span) {
Selectgetxmlxr();
if (cz_type == "ty") {
url = "aaa.ashx?type=ty&id=" + id;
}
xmlHttp.open("POST", url, false);
xmlHttp.onreadystatechange =function(){ fanhuizhi(span)};
xmlHttp.send(null);
}