响应.写入未显示在标志上
本文关键字:标志 显示 响应 | 更新日期: 2023-09-27 18:35:53
如果我能避免响应.write,那会有什么替代方案?
有人可以告诉为什么此响应消息没有出现吗? 直到最近才出现。
DirectorySearcher objADSearcher = new DirectorySearcher(de);
de.AuthenticationType = AuthenticationTypes.Secure;
objADSearcher.SearchRoot = de;
objADSearcher.Filter = "(SAMAccountName=" + item + ")";
SearchResult results = objADSearcher.FindOne();
if (results.ToString() != "")
{
int flags = Convert.ToInt32(results.Properties["userAccountControl"][0].ToString());
//for reference results.Properties["userAccountControl"][0].ToString().Equals("514");
if (Convert.ToBoolean(flags & 0x0002))
{
Response.Write("<script> alert ('" + "Account Disabled for more then 90 days, please call helpdesk at 1 xx.xx.xxx to activate your account" + "') </script>");
}
使用Response.Write的替代方法是像这样注册javascript:
ScriptManager.RegisterStartupScript(this, this.GetType, "Alert", "alert('this is a test');", true);