1
Answer

redirect question

dc

dc

12y
881
1
In a C# 2010 web application that I need to make changes to, there is code that says Page.Response.Redirect("test.aspx"). What does that mean versus Response.Redirect("test.aspx").

Is the part called "page' part of the command? The aspx pages I am using are also in a folder called 'page'.

Thus can you tell me what the 'page' is referring to in the statemnet above?
Answers (1)
0
Vulpes

Vulpes

NA 98.3k 1.5m 12y
The Page class has a Page property which it inherits from the Control class. This property returns a reference to the Page instance that contains the server control i.e. the current Page instance itself.

So, in other words, for code within _Default or any other sub-class of Page, all the following should do the same thing:

Response.Redirect(url);
this.Response.Redirect(url);
Page.Response.Redirect(url);
this.Page.Response.Redirect(url);
Accepted