I’m making a method that will be called from a webpage, which uses Server.Transfer to terminates execution of the current page and starts execution of a new page.
However, since the method I’m making is not an aspx page, Service Studio complains about the Server instance not existing in current context.
How can I circumvent this?
Use
HttpContext.Current(System.Web.HttpContext class defined in System.Web)Even if you are developing class library for web application you can reference and use it.
you would need
HttpContext.Current.Serverbut you may find other useful data there too.