简体   繁体   中英

An error occurred during the compilation of a resource required to service this request4

**Compilation Error**

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.marketing_incentives_convention_aspx' does not contain a definition for 'Convention' and no extension method 'Convention' accepting a first argument of type 'ASP.marketing_incentives_convention_aspx' could be found (are you missing a using directive or an assembly reference?)

I added code below

***convention.aspx file code*** 

%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Convention.aspx.cs" Inherits="MidlandAnnuityApps.Marketing.Incentives.Convention" %>

<%@ Register src="Convention.ascx" tagname="Convention" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Convention</title>

</head>
<body>
    <form id="form1" runat="server">
        <div class="AppDiv">
            <div id="ContentDiv"> 
                <uc1:Convention ID="Convention" runat="server" />
            </div>
        </div>
    </form>

    <iframe id="inneriframe" width="10" height="10" scrolling="no" ></iframe>

</body>


<script language="javascript" type="text/javascript" src="/_Template/script/iFrameScripts2.js"></script> 

</html>

***convention.aspx.cs code***

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MidlandAnnuity;

namespace MidlandAnnuityApps.Marketing.Incentives
{
    public partial class Convention : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

***convention.ascx code***

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Convention.ascx.cs"
    Inherits="MidlandAnnuity.Marketing.Incentives.Convention" %>
<style type="text/css">
    a:hover
    {
        color: #565555;
    }
</style>
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center">
    <tr>
        <td colspan="2">
            <img src="https://www.agentcertification.com/HostedImages/19541Images/BudapestHeader.jpg"
                alt="Missing Image" width="600" height="188" />
        </td>
    </tr>
    <tr>
        <td width="313" align="center">
            <img src="https://www.agentcertification.com/HostedImages/19541Images/BudapestLogo.jpg"
                width="300" height="175" />
        </td>
        <td width="287" align="center" valign="middle" bgcolor="#FFFFFF" class="links" style="padding: 10px;
            font-family: Arial, Helvetica, sans-serif; font-size: 12pt;">
            <p>
                <strong>Your Production Credits</strong>
            </p>
            <p align="center">
                <span style="font: bold 12pt arial,helvetica,sans-serif;">
                    <asp:Label ID="lblConventionCredits" runat="server"></asp:Label></span>
            </p>
            <p align="center" style="font: 10pt arial,helvetica,sans-serif;">
                    <a href="http://sfgmembers.wistia.com/medias/tyr5ydk7d3" target="_blank">
                        <img src="https://www.agentcertification.com/HostedImages/19541Images/BudapestVideo.jpg"
                            width="200" height="114" alt="Budapest Video" /></a>
                    <p style="font-size: 10pt; color: #000000">
                        <a href="http://sfgmembers.wistia.com/medias/tyr5ydk7d3" target="_blank">Watch this
                            video for a preview of all<br />
                            you'll experience in Budapest! </a>
                    </p>
                </p>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt;
            padding-left: 20px; padding-right: 20px;">
            <p>
                <br />
                A truly extraordinary experience awaits those who qualify for Midland National Annuity
                Division 2016 Agents’ Convention at the<a href="http://www.fourseasons.com/budapest/"
                    target="_blank"> Four Seasons Hotel Gresham Palace Budapest</a>. <strong>You'll create
                        memories to last a lifetime.</strong></p>
            <p style="font-size: 12pt; color: #7C1C1E;">
                <strong>May 20-24, 2016 - Main Convention</strong> <span style="font-size: 10pt;">(Gold,
                    Platinum and Diamond Levels)</span><br />
                <strong>May 18-20, 2016 - Platinum and Diamond Levels</strong></p>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt;
            padding-left: 20px; padding-right: 20px;">
            <p style="font-size: 13pt; color: #e38806; font-style: italic;">
                <strong>Celebrate the Past. Embrace the Future.</strong></p>
            <p style="font-size: 11pt;">
                Celebrate the past as you enjoy the panoramic views from the famous Fishermen's
                Bastion and explore the cobblestone streets of the Buda Castle District. Embrace
                the future while indulging in Budapest's unexpected elegance, ultra-modern accommodations,
                and delightful cuisine.
                <br />
                <br />
                With its quaint culture, remarkable markets, magnificent architecture and talks
                of a tumultuous history, Budapest is a city like no other. You'll create memories
                to last a lifetime...<strong>Budapest in 2016</strong>!</p>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt;
            padding-left: 20px; padding-right: 20px;">
            <p style="font-size: 13pt; color: #e38806; font-style: italic;">
                <strong>To Qualify</strong></p>
            <p>
                Qualification for the convention is based on eligible business issued between
                <br />
                January 1, 2015 and December 31, 2015. For more information, view our complete <a
                    href="https://www.midlandnational.com/group/mnportal/an-convention-qualification"
                    title="Convention Qualification Details" target="_blank">Qualification Details.</a></p>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="font-family: Arial, Helvetica, sans-serif; font-size: 8pt;
            color: #333333; padding: 20px;">
            <strong>FOR AGENT USE ONLY. NOT TO BE USED FOR CONSUMER SOLICITATION PURPOSES.</strong><br />
            19541Y-HTML | REV 2-15
        </td>
    </tr>
</table>
<script language="javascript" type="text/javascript" src="/_Template/script/iFrameScripts2.js"></script>

***convention.ascx.cs code***

using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Globalization;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using MidlandAnnuityApps.wsAnnuityAgent;
using log4net;
using log4net.Config;

namespace MidlandAnnuity.Marketing.Incentives
{
    public partial class Convention : ControlBase
    {
        protected System.Web.UI.WebControls.Label lblConventionCredits;
        private static ILog log = LogManager.GetLogger("ErrorLog");
        private static ILog infoLog = LogManager.GetLogger("InfoLog");

        protected void Page_Load(object sender, EventArgs e)
        {
            // Put user code to initialize the page here
            UserContext u = ((PageBase)Page).CurrUser;
            infoLog.Info(String.Format("Convention.ascx IsHomeOffice: {0}, IsImpersonationActive: {1}", u.IsHomeOffice, u.IsImpersonationActive));
            if (u.IsHomeOffice && u.IsImpersonationActive == false)
            {
                lblConventionCredits.Text = "0 - No Agent Emulated";
            }
            else
            {
                MidlandAnnuityApps.wsAnnuityAgent.AnnuityAgent svc = new MidlandAnnuityApps.wsAnnuityAgent.AnnuityAgent();
                string xml_data = svc.GetPremierClub(u.TIN);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xml_data);
                lblConventionCredits.Text = TryParse(doc.DocumentElement.GetAttribute("ConventionCredits"));
            }
        }

        private string TryParse(string number)
        {
            decimal x = -1;
            try
            {
                x = decimal.Parse(number);
                return (x.ToString("###,###,##0"));
            }
            catch
            {
                return (number);
            }
        }
    }
}

I think you have a naming conflict, change the ID to:

ID="ConventionControl"

And then fix the references in the code-behind to be ConventionControl... You have the control name and the ID both to Convention, and I think that is conflicting here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM