从后面的代码传递参数到URL

时间:2014-03-03 20:00:45

标签: asp.net paypal

returnURL += "&return=" + ConfigurationManager.AppSettings("SuccessURL").ToString()

如何在ASP.NET中将参数传递给此URL?

我尝试了但是没有用。也没有这样做:

returnURL += String.Format("return={0}&user{1}",Server.UrlEncode(ConfigurationManager.AppSettings("SuccessURL").ToString()),65)

网络配置中的代码:

<add key="SuccessURL" value="http://localhost:58690/Seller/Part1/Main.aspx" />

1 个答案:

答案 0 :(得分:0)

这是你应该做的:

在web.config中:

<add key="SuccessURL" value="http://localhost:58690/Seller/Part1/Main.aspx?bidid={0}" />

在代码中:

var successUrl = String.Format(ConfigurationManager.AppSettings("SuccessURL").ToString(), 65);

returnURL += "&return=" + successUrl;
相关问题