4

i want to call or Redirect ASPX page from CLASS File or inside function of class please help me or give Hint for that or Please write the statement for call or Redirect ASPX page from or in side Class

2 Answers 2

7

You simply do :

HttpContext.Current.Response.Redirect("~/myPage.aspx")

notice 2 things please :

1) you can use the tilde (~) to indicate the root of application

2) this (by default) will raise thread abort exception .you can eliminate it by olverload the method with false.

HttpContext.Current.Response.Redirect("~/myPage.aspx",false)

3) you should add using System.Web;

Sign up to request clarification or add additional context in comments.

Comments

0

You CLASS should derive from System.Web.UI.Page, inside your class you can use this below method

HttpResponse.Redirect(string url)

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.