更新时间:2023-12-05 23:07:58
当您使用更新面板时,您无法像上面那样调用javascript。你必须使用ScriptManager.RegisterStartupScript
只需更改你的
ClientScript.RegisterStartupScript(this.GetType(),,alert('无法删除'),true);
到ScriptManager.RegisterStartupScript(updatePanelId,updatePanelId.GetType()
,('无法删除'),javaScript,true);
hi i want tp display javascript alert message in .cs file here is my script ClientScript.RegisterStartupScript(this.GetType(), "", "alert(''Cannot Delete'')", true);
uplcityDetail.update()//update panel id
in .cs file but code is executeing alert is not displaying can any tell me please
When you use update panel then you can not call javascript like above. You have to useScriptManager.RegisterStartupScript
Just change yourClientScript.RegisterStartupScript(this.GetType(), "", "alert('Cannot Delete')", true);
toScriptManager.RegisterStartupScript(updatePanelId,updatePanelId.GetType() ,"('Cannot Delete')", javaScript, true);