My project's start page is Default.aspx.

    protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
    {

         Response.Redirect("Payment.aspx);

    }

When I click the button it returns //localhost/Default.aspx/Payment.aspx instead of //localhost/Payment.aspx. Where is the problem?

有帮助吗?

解决方案

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

其他提示

Try this.

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

The tilde (~) character represents the root directory of the application in ASP.NET.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top