我的aspx上有一个超链接,用户可以
http://something/leadoc/FnJavaView.aspx?Library=DefaultIMS:myserver:FileNet&Id=3611376&ObjType=2&Op=View
我在另一个网络应用程序上有相同的链接,当用户点击该链接时,它显示如下
http://something/leadoc/FnJavaView.aspx?Library=DefaultIMS%3amyserver%3aFileNet&Id=3611376&ObjType=2&Op=View
如果您注意到':'转换为%3a
因为该URL引发了错误。
你能帮忙吗?
答案 0 :(得分:0)
假设错误是从ASPX使用链接时您需要URL encode网址
string url = "http://something/leadoc/FnJavaView.aspx?Library={0}&Id={1}&ObjType={2}&Op={3}";
string library = Server.UrlEncode("Server.UrlEncode");
int id = 3611376;
int objType = 2;
string op = Server.UrlEncode("View");
url = string.Format(url, new object[]{library, id, objType, op});
任何动态字符串数据都应在查询字符串中进行URL编码。