I have a method in my project as per below which takes a HttpContext
object and returns a string
.
//returns the xml document as string
private static string GetXmlReceiptFromContext(HttpContext context)
{
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.Cache.SetNoStore();
context.Response.Cache.SetExpires(DateTime.MinValue);
return context.Request.Unvalidated.Form.Get("status");
}
The result of this is ultimately passed into a very important method that requires this string.
It appears that Context.Request.Unvalidated
is only available from .Net 4.5.
I need to alternative approach to this method for our servers which do not have .Net 4.5 and will be making use of this assembly.
Can anyone suggest an alternative way of accessing and returning the status parameter who's value will be an XML Document from the context without using Context.Request.Unvalidated?
edit
This is not for a webform or MVC project, we have developed a class library whch we ideally want to contain all the payment related features within the assembly, i.e. single responsibility, our front end apps which will be using this do not need to know about the payment side of things.