下面是我整个按钮的代码:private void Button1_Click(object sender, System.EventArgs e)
{
if(this.Action=="new") // 如果是新文件首先要保存,即用户直接提交
{
}
else
{
//首先要保存一下,防止用户做了修改
Response.Write("<script language=javascript>window.opener.document.forms[0].Save.click();</script>");
}
DataTable TypeTable=this.CreateTable("Select StepType from Workflow_Stepdef where AppID="+this.AppID+" and StepID="+this.StartStepID);
if(TypeTable.Rows[0]["StepType"].ToString().Trim()=="2")//前一步为归档,要做归档处理
{
this.Archive(); }
DataTable StepTypeTable=this.CreateTable("Select StepType from Workflow_Stepdef where AppID="+this.AppID+" and StepID="+this.GetEndStepID(FlowTo));
if(StepTypeTable.Rows[0]["StepType"].ToString().Trim()=="3")//如果选择的步骤的类型是结束的话,就结束,不需要重新操作数据库
{ //结束本流程
this.Over();
this.CloseSelf();
Response.Write("<script language=javascript>window.opener.document.forms[0].Redirect.click();</script>");
}
else
{
this.Redirect();
} //数据在这里的时候还是正确
}//在这里跳出的时候就出现错误了,数据被修改。。
{
if(this.Action=="new") // 如果是新文件首先要保存,即用户直接提交
{
}
else
{
//首先要保存一下,防止用户做了修改
Response.Write("<script language=javascript>window.opener.document.forms[0].Save.click();</script>");
}
DataTable TypeTable=this.CreateTable("Select StepType from Workflow_Stepdef where AppID="+this.AppID+" and StepID="+this.StartStepID);
if(TypeTable.Rows[0]["StepType"].ToString().Trim()=="2")//前一步为归档,要做归档处理
{
this.Archive(); }
DataTable StepTypeTable=this.CreateTable("Select StepType from Workflow_Stepdef where AppID="+this.AppID+" and StepID="+this.GetEndStepID(FlowTo));
if(StepTypeTable.Rows[0]["StepType"].ToString().Trim()=="3")//如果选择的步骤的类型是结束的话,就结束,不需要重新操作数据库
{ //结束本流程
this.Over();
this.CloseSelf();
Response.Write("<script language=javascript>window.opener.document.forms[0].Redirect.click();</script>");
}
else
{
this.Redirect();
} //数据在这里的时候还是正确
}//在这里跳出的时候就出现错误了,数据被修改。。
解决方案 »
- 在使用GridView时遇到的一个问题,求解!
- 关于RowCommand事件中GridView实现分页的问题。
- 页面嵌入视频的问题
- dv aspxASPxGridView 翻页 checkbox 选中问题
- 如果防止软件批量录入信息?
- 为什么相同web配置,而SqlDataSource1登录失败?
- 点击按钮有时会反应很慢
- SqlDataAdapter.Fill(dsReapter,5000,6000,myTable);中的5000和6000是什么意思啊
- ★★★关于模式窗体中的DataGrid不能导出到Excel的问题??
- 控件里面怎么用if做判断?
- 那位大哥会用Tree控件(分不够再加)
- C#的WebForm 中可不可以嵌套调用ASP网页
按钮会刷新页面,是不是在刷新时执行的呀 你好:
我上面的代码中:
Response.Write("<script language=javascript>window.opener.document.forms[0].Save.click();</script>");
这个代码可能改变数据。是不是这里引起的?
Response.Write("<script language=javascript>window.opener.document.forms[0].Save.click();</script>");
屏蔽掉之后,数据就对了,为什么程序执行完了。还要执行这句呢???
当然是跳出后才执行