我刚刚学习..任何人都可以请告诉我如何添加变量p = 1时请设置此PayPal参数字符串。这是它在mo上的工作状况。我只需要添加p = 1,但是我仍然认为语法错误。谢谢。添加另一个变量到PayPal URL查询字符串
paypalParameterString.Append("return=http://examplesite.com/accounts.aspx?page=" & Request.QueryString("page") & "&")
我刚刚学习..任何人都可以请告诉我如何添加变量p = 1时请设置此PayPal参数字符串。这是它在mo上的工作状况。我只需要添加p = 1,但是我仍然认为语法错误。谢谢。添加另一个变量到PayPal URL查询字符串
paypalParameterString.Append("return=http://examplesite.com/accounts.aspx?page=" & Request.QueryString("page") & "&")
如果你想更多的参数添加到您需要的参数之间增加一个符号(&)的URL。例如
http://examplesite.com/accounts.aspx?parameter1=foo¶meter2=bar
所以,如果你想添加参数p与值1到你这上面提到的网址应该是这样的
paypalParameterString.Append("return=http://examplesite.com/accounts.aspx?page=" & Request.QueryString("page") & "&p=1")
如果你不想硬编码值1
paypalParameterString.Append("return=http://examplesite.com/accounts.aspx?page=" & Request.QueryString("page") & "&p=" & value)
您将需要encode您的网址,因为它是参数的一部分。
将您的网址字符串变量
url = "http://examplesite.com/accounts.aspx?page=" & Request.QueryString("page") & "&p=1"
然后通过确保编码它
paypalParameterString.Append("return=" & Server.UrlEncode(url))
其添加为参数,这将(例如)转换&为%26
注意:如果您需要,您可以将所有内容放在同一行上
paypalParameterString.Append(Server.UrlEncode("return=http://examplesite.com/accounts.aspx?page=" & Request.QueryString("page") & "&p=1"))
试过这个,但它从PayPal返回到只是http://www.examplesite.com/accounts.aspx?page=3 – Eggybread