The program has not been modified and has been running normally. Suddenly one day, a colleague informed me that an error had occurred. After inspection, it was found that special characters such as # appeared in the transmitted data. The browser only retrieved the data before the # sign, and the subsequent data was truncated. Then I first thought of encoding the data using the Server.UrlEncode method. Although you can see that the special characters have been encoded, the correct data is still not passed and the error remains.
"JavaScript:window.showModalDialog('Info.aspx? bh=" Server.UrlEncode(e.Row.Cells.FromKey("number").Text.Trim()) "',null,'dialogWidth:750px;dialogHeight:500px;center:yes;status:no;resizable: yes;');"
After using the Escape method, the parameters are passed normally:
"JavaScript:window.showModalDialog('Info.aspx?bh=' escape("" e.Row.Cells.FromKey("number").Text.Trim( ) ""),null,'dialogWidth:750px;dialogHeight:500px;center:yes;status:no;resizable:yes;');"
But if you do not use a modal window but directly If you use Server.UrlEncode to open the link address, there will be no problem. It's very strange. Can anyone give me some advice?