url编码问题
<a href='javascript:parent.RSMenu.Open("Customer/ConsumerIdentify.aspx?consumerId=0107512752&targetUrl=../Order/OrderEntry.aspx?ActionType=Audit%26OrderId=W0411482948", "inputOrder", "FrameClass")'>W0411482948</a>
这个是url嵌套一个Url,我把targetUrl中&用<%#Server.UrlEncode("&")%>后是%26,,当我的url传入到RSMenu.Open()中的时候&的编码无效了,
url又变为这样了Customer/ConsumerIdentify.aspx?consumerId=0107512752&targetUrl=../Order/OrderEntry.aspx?ActionType=Audit&OrderId=W0411482948这样后面的OrderId就会成为前面url的参数了。
这是为什么啊,都编码过了,就是把url传到js方法里面编码怎么就不行了饿,求大神指教啊,急急急急,在线等
------解决方案--------------------
你可以这样试试
<a href='javascript:parent.RSMenu.Open("Customer/ConsumerIdentify.aspx?consumerId=0107512752&targetUrl=" + encodeURIComponent("../Order/OrderEntry.aspx?ActionType=Audit%26OrderId=W0411482948"), "inputOrder", "FrameClass")'>W0411482948</a>
------解决方案--------------------
<a href='javascript:parent.RSMenu.Open("Customer/ConsumerIdentify.aspx?consumerId=<%#((RSDSBL.Order.OrderHeader)Container.DataItem).ConsumerId%>&targetUrl="+encodeURIComponent("../Order/OrderEntry.aspx?ActionType=Audit&<%#"OrderId="+((RSDSBL.Order.OrderHeader)Container.DataItem).OrderId %>")/>用这样试试