Hello,
I am trying to have my web page inherit from another page in .Net 2.0. It usually works fine, but every once in a while some or all of the child pages return this error:
The type or namespace name 'NETBasePage' could not be found
(are you missing a using directive or an assembly reference?)
If I check everything back into Source Safe and check it out again it will work fine for a while and then I will start getting the error again.
This is what my code looks like:
and here is the base class:
Thanks for any help,
Bill
I am trying to have my web page inherit from another page in .Net 2.0. It usually works fine, but every once in a while some or all of the child pages return this error:
The type or namespace name 'NETBasePage' could not be found
(are you missing a using directive or an assembly reference?)
If I check everything back into Source Safe and check it out again it will work fine for a while and then I will start getting the error again.
This is what my code looks like:
Code:
public partial class MailerEditNET_ProdCat : NETBasePage
and here is the base class:
Code:
public partial class NETBasePage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
#region Deserialize the Mailer class
protected Mailer DeserializeMailer()
{
HtmlInputHidden hid = new HtmlInputHidden();
Page callingpage = (Page)Context.Handler;
hid = (HtmlInputHidden)callingpage.FindControl("hdnMailer");
string mailer = hid.Value;
if (mailer.Length > 0)
{
byte[] normalisedForm;
normalisedForm = Convert.FromBase64String(mailer);
if (normalisedForm.Length > 0)
{
BinaryFormatter serializer = new BinaryFormatter();
MemoryStream ms = new MemoryStream(normalisedForm);
return (Mailer)serializer.Deserialize(ms);
}
}
return null;
}
#endregion
#region Serialize the Mailer class
protected string SerializeMailer(Mailer mailer)
{
IFormatter formatter = new BinaryFormatter();
MemoryStream str = new MemoryStream();
formatter.Serialize(str, mailer);
string formSafe = Convert.ToBase64String(str.ToArray());
return formSafe;
}
#endregion
#region Check to see if Mailer class has been serialized
protected bool CheckSerialization()
{
HtmlInputHidden hid = new HtmlInputHidden();
Page callingpage = (Page)Context.Handler;
hid = (HtmlInputHidden)callingpage.FindControl("hdnMailer");
string mailer = hid.Value;
if (mailer.Length > 0)
return true;
else
return false;
}
#endregion
Thanks for any help,
Bill