读书人

alert的一个小疑点

发布时间: 2012-01-23 21:57:28 作者: rapoo

alert的一个小问题
string strtemp = "保存位置: " + Request.PhysicalApplicationPath + "Test ";
Page.RegisterStartupScript( " ", " <script> alert( ' " + strtemp + " '); </script> ");

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

[解决办法]
被js理解成转移字符了

string strtemp =Request.PhysicalApplicationPath.Replace(@ "\ ",@ "\\ ");

读书人网 >asp.net

热点推荐