Response.Write和Response.Redirect一起用的时候就会这样,write脚本和redirect脚本不能同时使用,这样不会执行脚本,最好使用ClientScript

改进方法:

方法一:

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language=javascript >alert('弹出对话框!');</script>");
Response.Redirect("page.aspx");

方法二:

Response.Write("<script>alert('弹出对话框!');window.location.href = 'page.aspx';</script>");

方法三:

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language=javascript >alert('弹出对话框!');window.location.href = 'page.aspx';</script>");

最新文章

  1. 安装ArcGIS Engine 9.3
  2. jquery div 下拉框焦点事件
  3. Bash命令积累
  4. java基础—继承题目:编写一个Animal类,具有属性:种类;具有功能:吃、睡。定义其子类Fish
  5. NopCommerce功能与特点介绍
  6. vi-11
  7. Know How To Use ID_NULL Function To Search An Object In Oracle Forms
  8. Http中Cookie和Session介绍
  9. OpenJudge 2757 最长上升子序列 / Poj 2533 Longest Ordered Subsequence
  10. Google Map API v2 步步为营 (二)----- Location
  11. WebGL文字渲染的那些问题
  12. Union和Union All 的区别
  13. php curl 跨域情趣
  14. Mysql5.5安装
  15. &quot;Linux内核分析&quot;第七周
  16. bzoj千题计划198:bzoj1084: [SCOI2005]最大子矩阵
  17. CAS (8) —— Mac下配置CAS到JBoss EAP 6.4(6.x)的Standalone模式(服务端)
  18. Distributed3:SQL Server 分布式数据库性能测试
  19. PHP面试系列之Linux(一) ----- Linux基础
  20. Python Pygame (2) 事件

热门文章

  1. 2016java技术岗面试题
  2. HTML 字符图案
  3. Dynamics AX 2012 在BI分析中建立数据仓库的必要性
  4. .net 验证码
  5. easyui dialog iframe
  6. jmeter agent配置
  7. PHPCMS企业站制作
  8. Python3基础 访问列表指定索引值的元素
  9. 20161127-adt bundle
  10. GOLANG 声明