我需要从gvLocations_RowDeleting部分的网格视图中的if条件调用javascript警报。
代码如下:
protected void gvLocations_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (CheckIfLocationExists(ID) == true)
{
//need to call javascript function sendmessage() here??
}
}我在.aspx文件中有一个javascript函数,如下所示
<script type="text/javascript">
function sendmessage()
{
alert("Area is associated with this location already");
}
</script>我知道这是一个简单的步骤,但由于某些原因,我遇到了麻烦。有人能帮帮忙吗?提前谢谢。堆叠溢流石!
发布于 2011-02-12 04:02:50
实际上我想通了。希望这能帮助一些人else..Use下面的代码,像符咒一样工作..
Page.ClientScript.RegisterStartupScript(this.GetType(), "helloworldpopup", "alert('hello world');", true);https://stackoverflow.com/questions/4973340
复制相似问题