我上的一个按钮的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
指导我如何解决这个问题,因为我想关闭按钮点击事件后的网页。