0

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?

Burak
  • 478
  • 1
  • 6
  • 18

2 Answers2

3
Response.Redirect("~/Payment.aspx");
Ali Baghdadi
  • 648
  • 1
  • 5
  • 17
1

Try this.

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

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

naveen
  • 53,448
  • 46
  • 161
  • 251