出現了一個很奇怪的問題,不知道是哪里設置錯了,還是怎么回事,我使用Server.UrlEncode() 編碼一個字符串,出來的值竟然沒有進行編碼,查原因,那就叫個糾結啊,使用其他方法可以解決,但是小弟就像弄明白倒是是怎么回事,什么原因,求各位大俠,高手給予指導,謝謝,大家一起探討一下,代碼如下:編碼前,前提是在gridview中使用的哈。protected void Grid_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["style"] = "Cursor:hand"; e.Row.Attributes.Add("onmouseover", "c=style.backgroundColor;style.backgroundColor='#add8e6'"); e.Row.Attributes.Add("onmouseout", "style.backgroundColor=c"); string sp_code = Grid.DataKeys[e.Row.RowIndex].Value.ToString(); string cal_url = String.Format("SupplierEdit.aspx?spCode={0}", Server.UrlEncode(sp_code)); e.Row.Attributes.Add("ondblclick", String.Format("document.location.href='{0}'", cal_url)); } } 編碼后網頁地址參數:Company/SupplierEdit.aspx?spCode=SP00001然后我就郁悶了,求給位給個解釋,分數就給少了哈,高手不會太在意豆豆的。謝啦哈。
- 1 回答
- 0 關注
- 489 瀏覽
添加回答
舉報
0/150
提交
取消