I'm new to c#. I have this class...
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public class clsErrorMessages
{
string _sErrors;
public clsErrorMessages(string sErrorTextFileName)
{
_sErrors = (String)GetGlobalResourceObject("resource","FriendlyErrors.txt");
}
}
The compiler says the name 'GetGlobalResourceObject' does not exist in the current context
Do I need to include another using
?
The GetGlobalResourceObject() method is a static member of the HttpContext class. You need to qualify it as such:
_sErrors = (string) HttpContext.GetGlobalResourceObject("resource",
"FriendlyErrors.txt");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With