【问题标题】:Asp.net Response.RedirectAsp.net 响应.重定向
【发布时间】:2014-03-18 07:38:52
【问题描述】:

我的项目的起始页是 Default.aspx。

    protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
    {

         Response.Redirect("Payment.aspx);

    }

当我单击按钮时,它返回 //localhost/Default.aspx/Payment.aspx 而不是 //localhost/Payment.aspx。问题出在哪里?

【问题讨论】:

  • 你试过 Response.Redirect("~/Payment.aspx"); 吗?
  • @AliBaghdadi:这就是答案。为什么将其发布为评论?
  • 谢谢@Ali,如果你愿意,请写下这个答案,我会接受的。成功了。

标签: asp.net response.redirect


【解决方案1】:
Response.Redirect("~/Payment.aspx");

【讨论】:

    【解决方案2】:

    试试这个。

    Response.Redirect("~/Payment.aspx");
    

    波浪号 (~) 字符表示 ASP.NET 中应用程序的根目录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-25
      • 2012-01-19
      • 2011-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多