I am adding a form to a fairly standard 1.6 install and am getting a parser error, shown below.
Begin Error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'NopSolutions.NopCommerce.Web.Modules.RequestTrialControl'.
Source Error:
Line 1: <%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Modules.RequestTrialControl"
Line 2: CodeBehind="RequestTrial.ascx.cs" %>
Line 3: <%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="~/Modules/SimpleTextBox.ascx" %>
Source File: /Modules/RequestTrial.ascx Line: 1
End Error
The code from the C# file is listed below.
namespace NopSolutions.NopCommerce.Web.Modules
{
public partial class RequestTrialControl : BaseNopUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
protected void BindData()
{
if (NopContext.Current.User != null && !NopContext.Current.User.IsGuest)
{
txtFullName.Text = NopContext.Current.User.FullName;
txtEmail.Text = NopContext.Current.User.Email;
}
}
protected void btnRequestTrial_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
try
{
if (String.IsNullOrEmpty(txtEnquiry.Text))
return;
string email = txtEmail.Text.Trim();
string fullName = txtFullName.Text.Trim();
string subject = string.Format("{0}. {1}", SettingManager.StoreName, "Contact us");
string body = MessageManager.FormatContactUsFormText(txtEnquiry.Text);
var from = new MailAddress(email, fullName);
//required for some SMTP servers
if (SettingManager.GetSettingValueBoolean("Email.UseSystemEmailForRequestTrialForm"))
{
from = new MailAddress(MessageManager.AdminEmailAddress, MessageManager.AdminEmailDisplayName);
body = string.Format("<b>From</b>: {0} - {1}<br /><br />{2}", Server.HtmlEncode(fullName), Server.HtmlEncode(email), body);
}
var to = new MailAddress(MessageManager.AdminEmailAddress, MessageManager.AdminEmailDisplayName);
MessageManager.InsertQueuedEmail(5, from, to, string.Empty, string.Empty, subject, body, DateTime.Now, 0, null);
pnlResult.Visible = true;
pnlRequestTrial.Visible = false;
}
catch (Exception exc)
{
LogManager.InsertLog(LogTypeEnum.MailError, string.Format("Error sending \"Contact us\" email."), exc);
}
}
}
}
}