i 只是注意到,如果删除<代码>和>;掌握:更新......<>/代码>,则发出警报信息。
我的守则是,如何提醒人们注意由密码背后发出的信息,我已经尝试过一些方法,但我从未发出警报。
protected void gv_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == CRUID.Delete.ToString())
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert( Deleted successfully! );", true);
or
// Define the name and type of the client scripts on the page.
String csname1 = "PopupScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
StringBuilder cstext1 = new StringBuilder();
cstext1.Append("<script type=text/javascript> alert( Hello World! ) </");
cstext1.Append("script>");
cs.RegisterStartupScript(cstype, csname1, cstext1.ToString());
}
}
}
protected override void Page_Load(object sender, EventArgs e)
{
gv.DataSourceID = "gvDataSource";
}
ps: iam using objectdatasource to bind my gridview control