Hello,
Sorry for confusion, I did not realize you need the previous Url. Regrettably, Kentico 
CMS does not provide any property that can be used to retrieve this information. So, you will need to use either the javascript as a client side alternative or get the information you need from the 
HttpContext.Current.Request.ReferrerUrl.PathAndQuery property.
Best regards,
Michal Legen