当前位置: 代码迷 >> ASP.NET >> alert的一个小疑点
  详细解决方案

alert的一个小疑点

热度:4409   发布时间:2013-02-25 00:00:00.0
alert的一个小问题
string   strtemp   =   "保存位置: "   +   Request.PhysicalApplicationPath   +   "Test ";
Page.RegisterStartupScript( " ",   " <script> alert( ' "   +   strtemp   +   " '); </script> ");

这样提示的路径中没有 "\ ",是什么原因呢?

------解决方案--------------------------------------------------------
被js理解成转移字符了

string strtemp =Request.PhysicalApplicationPath.Replace(@ "\ ",@ "\\ ");
  相关解决方案