簡體   English   中英

在為該請求提供服務所需的資源的編譯過程中發生錯誤4

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

**Compilation Error**

說明:編譯服務於此請求所需的資源期間發生錯誤。 請查看以下特定的錯誤詳細信息,並適當地修改您的源代碼。

編譯器錯誤消息: CS1061:'ASP.marketing_incentives_convention_aspx'不包含'Convention'的定義,並且找不到擴展方法'Convention'接受類型為'ASP.marketing_incentives_convention_aspx'的第一個參數(您是否缺少使用指令或組裝參考?)

我在下面添加了代碼

***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);
            }
        }
    }
}

我認為您存在命名沖突,請將ID更改為:

ID="ConventionControl"

然后將后面的代碼中的引用固定為ConventionControl ...您擁有既是Convention的控件名稱又是ID,我認為這里存在沖突。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM