UpdateCommand后如何刷新页面
protected void FpSpread1_UpdateCommand(object sender, SpreadCommandEventArgs e){
string a = this.Request.Form["__EVENTARGUMENT"];
int Row = Convert.ToInt16(e.CommandArgument);
if (a != "Update") { return; }
List<Model.UserDevelopmentMeasuresModel> listUserDevelopmentMeasures = new List<Model.UserDevelopmentMeasuresModel>();
BLLUserDevelopmentMeasures bllUserDevelopmentMeasures = new BLLUserDevelopmentMeasures(lblYear.Text.Trim());
Model.UserDevelopmentMeasuresModel model = new Model.UserDevelopmentMeasuresModel();
model.Id = FpSpread1.Sheets.Cells.Value.ToString();
model.Development = "";
if (e.EditValues.ToString() != "System.Object")
{
model.Development = e.EditValues.ToString();
}
model.Responsible = "";
if (e.EditValues.ToString() != "System.Object")
{
model.Responsible = e.EditValues.ToString();
}
model.Module = "";
if (e.EditValues.ToString() != "System.Object")
{
model.Module = e.EditValues.ToString();
}
model.Details = "";
if (e.EditValues.ToString() != "System.Object")
{
model.Details = e.EditValues.ToString();
}
model.Status = "";
if (e.EditValues.ToString() != "System.Object")
{
model.Status = e.EditValues.ToString();
}
model.UpdateDate = "";
if (e.EditValues.ToString() != "System.Object")
{
model.UpdateDate = e.EditValues.ToString();
}
model.Owner = "";
if (e.EditValues.ToString() != "System.Object")
{
model.Owner = e.EditValues.ToString();
}
listUserDevelopmentMeasures.Add(model);
if (bllUserDevelopmentMeasures.UpdateUserDevelopmentMeasures(listUserDevelopmentMeasures))
{
}
InitCellTypes(FpSpread1.Sheets, lblPersonNo.Text, lblYear.Text);
//Response.Redirect(string.Format("~/UserDevelopmentMeasures.aspx?personno={0}&Year={1}", lblPersonNo.Text, lblYear.Text));
lblTotalCost.Text = bllUserDevelopmentMeasures.GetUserTotalCost(lblPersonNo.Text.Trim());
}
执行FpSpread1_UpdateCommand完后,debug可以跟到 lblTotalCost.Text 被成功赋值,但是页面上lblTotalCost的框中无法显示内容,请问如何在UpdateCommand完后将页面刷新,将lblTotalCost的框中内容显示出来 lblTotalCost这是个什么东西? 回复 2楼gw0506的帖子
是textbox 回复 3楼Bosch的帖子
谢谢您的反馈。
这个问题我们收到了,我们测试下然后给您反馈。 回复 2楼gw0506的帖子
怎么没有回音了 抱歉,这个问题意外的让你等了这么久。还请你见谅。
目前是这样的,如果要在UpdateCommend中修改Spread以外的控件的值,需要重写UpdateCommend。代码如下:
protected override void Render(HtmlTextWriter writer)
{
WebControl update = this.FpSpread1.FindControl("Update") as WebControl;
update.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(FpSpread1, "Update,-1,-1") + "; return false;");
base.Render(writer);
}
protected void FpSpread1_UpdateCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "newwin", "<script type ='text/javascript'> alert('UpdateCommand Test')</script>");
this.TextBox1.Text = "dd";
}
不过我建议你看有没有可能换个时机去修改textbox的值?
页:
[1]