2012-04-11 71 views
0

我需要在PayPal服务被用户接受后重定向到页面。我想重定向的页面遵循以下结构:如何在ASPX中重定向到当前页面的兄弟页面或子文件夹页面

  • Me.aspx
  • \宝\ Accept.aspx
  • \宝\ Cancel.aspx
  • \宝\ Finish.aspx

,所以如果我在http://localhost:63000/myfolder/me.aspx

我想通过贝宝被重定向到http://localhost:63000/myfolder/paypal/accept.aspx

如何?

+0

好的。得到它的工作! 我可以使用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

回答

0

好的。得到它的工作!

我可以使用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沙盒正常返回。

相关问题