我需要在PayPal服务被用户接受后重定向到页面。我想重定向的页面遵循以下结构:如何在ASPX中重定向到当前页面的兄弟页面或子文件夹页面
- Me.aspx
- \宝\ Accept.aspx
- \宝\ Cancel.aspx
- \宝\ Finish.aspx
,所以如果我在http://localhost:63000/myfolder/me.aspx
我想通过贝宝被重定向到http://localhost:63000/myfolder/paypal/accept.aspx
如何?
我需要在PayPal服务被用户接受后重定向到页面。我想重定向的页面遵循以下结构:如何在ASPX中重定向到当前页面的兄弟页面或子文件夹页面
,所以如果我在http://localhost:63000/myfolder/me.aspx
我想通过贝宝被重定向到http://localhost:63000/myfolder/paypal/accept.aspx
如何?
好的。得到它的工作!
我可以使用HttpContext.Current让我当前的URL,然后重写当前页面的子目录和页面:
ReturnURL = HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Replace("me", "PayPal/Accept")
如果HttpContext.Current.Request.Url.AbsoluteUri是http://localhost:63000/myfolder/me.aspx
然后RETURNURL是http://localhost:63000/myfolder/PayPal/Accept.aspx
,PayPal沙盒正常返回。
ReturnURL = HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Replace("me", "PayPal/Accept")
如果HttpContext.Current.Request.Url.AbsoluteUri是http://localhost:63000/myfolder/me.aspx然后RETURNURL是http://localhost:63000/myfolder/PayPal/Accept.aspx,和PayPal沙箱返回正常。
将其作为答案,让其他人可以轻松找到答案 – 2012-04-11 08:49:25
好的。得到它的工作! 我可以使用HttpContext.Current获取我当前的Url,然后将当前页面重写到子目录和页面: ReturnURL = HttpContext.Current.Request.Url.AbsoluteUri.ToLower()。Replace(“me”,“PayPal /接受“) 如果'HttpContext.Current.Request.Url.AbsoluteUri'是 '的http://本地主机:63000/MyFolder文件/ me.aspx' 然后'ReturnURL'是 '的http:// localhost:63000/myfolder/PayPal/Accept.aspx', 和PayPal沙箱正常返回。 – 2012-04-11 08:45:57