I have a user control which overriding Page_load method, however what I want is, redirect user from where they came from, it can be on “ON INIT method” or any method as long as user is redirected.
This is what I got at the moment,
public partial class ASPUserControl: System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
You can use the
UrlReferrerHowever, the
UrlReferreris only populated if the user clicked on a link(f.e. viaPostBackUrl) or similar, not if you’ve usedResponse.Redirectto go to this page. If you’ve usedServer.Transferyou could usePage.PreviousPageto get the url.