if (rowExist) { returnText = "Du er allerede tilmeldt en reminder på dette produkt"; } else { returnText = "Du er nu tilmeldt en reminder på dette produkt og vil modtage en E-mail når vi igen har varen på lager."; }
System.NullReferenceException: Object reference not set to an instance of an object.
at EmailReminderOccShop.ReminderDAL..ctor()
at EmailReminderOccShop.ReminderBLL..ctor()
at EmailReminderOccShop.Reminder.SendMail(Int32 NodeId, String Email, Int32 ReminderEmailNodeId)
Nullref in custom XSLT ext
I have made my ovn extension in VS2010 it's contains
Reminder.cs
namespace EmailReminderShop
{
public class Reminder
{
public static string SendMail(int NodeId, string Email, int ReminderEmailNodeId)
{
string returnText = "testc";
ReminderBLL BLL = new ReminderBLL();
ReminderItem ReminderToInsert = new ReminderItem();
ReminderToInsert.email = Email;
ReminderToInsert.nodeId = NodeId;
bool rowExist = BLL.InsertReminder(ReminderToInsert);
if (rowExist)
{
returnText = "Du er allerede tilmeldt en reminder på dette produkt";
}
else
{
returnText = "Du er nu tilmeldt en reminder på dette produkt og vil modtage en E-mail når vi igen har varen på lager.";
}
return returnText;
}
}
}
ReminderBLL.cs
ReminderDAL.cs
ReminderItem.cs
In the xsltconfig i have added:
<ext assembly="EmailReminderShop" type="EmailReminderShop.Reminder" alias="myExt">
</ext>
in the xslt i use
<xsl:value-of select="myExt:SendMail('1204', '[email protected]', '1115')"/>
when i try to save it i get this
System.NullReferenceException: Object reference not set to an instance of an object.
at EmailReminderOccShop.ReminderDAL..ctor()
at EmailReminderOccShop.ReminderBLL..ctor()
at EmailReminderOccShop.Reminder.SendMail(Int32 NodeId, String Email, Int32 ReminderEmailNodeId)
but why???
Hi Jakob
Since you're using integers should'nt you the call the extension like
<xsl:value-of select="myExt:SendMail(1204, '[email protected]', 1115)"/> - without the '' around the id's?
/Jan
thx that help me to get a new error.
Fogot to move my CustomTabel to the new SQLServer.
Hi Jakob
So this is solved or still bugging after the CustomTabel was moved over?
/Jan
that solved it thx :-)
is working on a reply...