从aspx后台页面输出js文件

Response.Clear();
Response.Charset 
= "utf-8";
Response.Buffer 
= true;
            
Response.ContentEncoding 
= System.Text.Encoding.UTF8;
Response.AddHeader(
"Content-Disposition""attachment;filename=js.js");
Response.ContentType 
= "application/octet-stream";
Response.Write(
"<script>alert('aaa');</script>");            
Response.End();

相关文章:

  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-05-21
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2021-12-14
  • 2022-01-30
  • 2022-01-15
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案