js能接收服务器发来的消息吗,JavaScript错误:从服务器收到的消息无法解析

我上的一个按钮的OnClientClick事件打开ShowModalDialog的,并为它的JavaScript是: -JavaScript错误:从服务器收到的消息无法解析

function openmodalWinLunch() {

var variable1 = "Lunch";

window.showModalDialog("ClockPopUP.aspx?code=" + variable1, "dialogWidth:290px;dialogHeight:270px,");

}

在Clock.aspx页我有我写的代码ASP按钮: -

protected void btnStop_Click(object sender, EventArgs e)

{

_nonProduction = new NonProduction();

if (Session["LastNonProdTimeID"] == null)

{

}

else

{

int NonProdTimeEntryID = Convert.ToInt32(Session["LastNonProdTimeID"]);

//Updating the TimeSpent

isTimeSpentUpdated = _nonProduction.UpdateTimeSpentInDB(NonProdTimeEntryID);

if (isTimeSpentUpdated == true)

{

string timespent = Convert.ToString(_nonProduction.GetTimeSpent(NonProdTimeEntryID));

//string msg = "Total time consumed in " +HiddenTaskname.Value.ToString()+": " + timespent.ToString() + " Minutes";

Response.Write("");

Response.End();

}

else

{

}

}

}

Preveously每一件事情是工作的罚款,该代码工作按我的要求。只是我在Clock.aspx上添加了Scriptmanager,因为我正在显示一个显示用户已用时间的时钟。之后,当我点击CLock.aspx页面上的btn_Stop时,我收到以下错误消息: - “Microsoft JScript运行时错误:Sys.WebForms.PageRequestManagerParserErrorException:从服务器收到的消息无法解析。”

请指导我如何解决这个问题。

我发现这个错误的根本原因是什么。这是因为我使用Resonse.Write和其他信息是Here

指导我如何解决这个问题,因为我想关闭按钮点击事件后的网页。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值