The program has never been changed and runs normally. suddenly one day, my colleague told me that an error occurred. After inspection, it is found that the transmitted data contains special characters such as #. the browser only obtains the data before # And the data after it is truncated. First, we thought about encoding the data using the Server. UrlEncode method. Although we can see that the special characters have been encoded, the correct data is still not passed and the error persists.
Copy codeThe Code is as follows:
"JavaScript: window. showModalDialog ('info. aspx? Bh = "+ Server. urlEncode (e. row. cells. fromKey ("no "). text. trim () + "', null, 'dialogwidth: 750px; dialogHeight: 500px; center: yes; status: no; resizable: yes ;');"
After the Escape method is used, the parameter is passed normally:
Copy codeThe Code is as follows:
"JavaScript: window. showModalDialog ('info. aspx? Bh = '+ escape (\ "" + e. row. cells. fromKey ("no "). text. trim () + "\"), null, 'dialogwidth: 750px; dialogHeight: 500px; center: yes; status: no; resizable: yes ;');"
However, if the link address is opened directly instead of using a modal window, Server. UrlEncode is no problem. It is strange that you can give some advice on the big wet mode.