页面动态注册脚本(小技巧)

this.Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", "function LogOffFunction() { if (confirm('Are you sure you logoff')) {return true;} else {return false;} }", true);
        Button1.Attributes.Add("onclick", "return LogOffFunction()");

你可能感兴趣的:(小技巧)