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?

3
  • 2
    have you tried Response.Redirect("~/Payment.aspx");? Commented Mar 18, 2014 at 7:40
  • @AliBaghdadi: Thats the answer. Why posted it as a comment? Commented Mar 18, 2014 at 7:41
  • Thank you @Ali, if you want, write that as an answer and i'll accept it. It's worked. Commented Mar 18, 2014 at 7:42

2 Answers 2

3
Response.Redirect("~/Payment.aspx");
Sign up to request clarification or add additional context in comments.

Comments

1

Try this.

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.