我知道这个问题已经发布了几次,但我已经尝试了那些没有找到解决方案的答案。
我的问题是我的控件(在特定的aspx文件中)没有显示在设计器文件中。这使得很难从代码隐藏中访问某些控件。
我尝试了什么:
我缺少什么?!
我在使用Visual Studio 2013,最新版本。
Aspx文件
<%@ Page Language="C#" MasterPageFile="Framework/Email.master" Inherits="OrderConfirmationEmail1" EnableViewState="false" Codebehind="OrderConfirmationEmail1.aspx.cs" AutoEventWireup="True" %>
<asp:Content ContentPlaceHolderID="Content" runat="server">
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<web:UsePage runat="server" StructureLevel="1">
<web:PageLink runat="server">
<site:UseWebsiteSettings runat="server">
<web:Image runat="server" MaxWidth="200" Name="Logotype1" />
</site:UseWebsiteSettings>
</web:PageLink>
</web:UsePage>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"> </td></tr>
<tr>
<td style="font: bold 16px Arial, Sans-serif;"><web:Text runat="server" Name="Title" /></td>
<td style="font: bold 16px Arial, Sans-serif; text-align: right;"><web:Text runat="server" Name="OrderNumberLabel" /> <Ecom:OrderID runat="server"></Ecom:OrderID></td>
</tr>
<tr><td colspan="2"> </td></tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td bgcolor="#f6f6f6" style="font: 14px Arial, Sans-serif;"><strong><web:Text runat="server" Name="DeliveryTitle" /></strong></td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<Ecom:DeliveryRepeater runat="server">
<ItemTemplate>
<Ecom:FirstName runat="server" />
<Ecom:LastName runat="server" /><br/>
<Ecom:Address1 runat="server" />
<Ecom:Address2 runat="server" /><br/>
<Ecom:Zip runat="server" />
<Ecom:City runat="server" /><br/>
<Ecom:Country runat="server" /><br/>
<Ecom:Phone runat="server" />
</ItemTemplate>
</Ecom:DeliveryRepeater>
</td>
</tr>
<tr><td> </td></tr>
</table>
<%// Order rows %>
<Ecom:OrderRowRepeater runat="server" OnItemDataBound="OnOrderItemDataBound" OnItemCreated="OnOrderItemCreated" RenderEmpty="True">
<HeaderTemplate>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td bgcolor="#f6f6f6" style="font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderProductsColumnTitle" runat="server" /></strong>
</td>
<td bgcolor="#f6f6f6" style="text-align: right;font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderQuantityColumnTitle" runat="server" /></strong>
</td>
<td bgcolor="#f6f6f6" style="text-align: right;font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderPriceColumnTitle" runat="server" /></strong>
</td>
<td bgcolor="#f6f6f6" style="text-align: right;font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderTotalColumnTitle" runat="server" /></strong>
</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<ItemTemplate>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<strong><PC:DisplayName runat="server" /></strong>
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderRowQuantity runat="server" />
<web:Text runat="server" Name="OrderRowQuantityAbbreviation"/>
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderRowHasCampaign runat="server">
<OnTrue>
<Ecom:OrderRowCampaignPrice DisplayCurrencySymbol="true" runat="server" />
</OnTrue>
<OnFalse>
<Ecom:OrderRowListPrice runat="server" DisplayCurrencySymbol="true" />
</OnFalse>
</Ecom:OrderRowHasCampaign>
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderRowTotalPrice DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
</ItemTemplate>
</Ecom:OrderRowRepeater>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowDiscountTitle" runat="server" />
</td>
<td></td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalDiscountAmount DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowDeliveryMethodTitle" runat="server" />
</td>
<td style="font: 14px Arial, Sans-serif;">
<Ecom:DeliveryMethodDisplayName runat="server" />
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalDeliveryCost DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowPaymentMethodTitle" runat="server" />
</td>
<td style="font: 14px Arial, Sans-serif;">
<Ecom:PaymentMethodDisplayName runat="server" />
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalFee DisplayCurrencySymbol="True" runat="server" />
</td>
</tr>
<tr class="grandtotal">
<td style="font: 18px Arial, Sans-serif;">
<web:Text Name="OrderRowTotalTitle" runat="server" />
</td>
<td></td>
<td style="text-align: right; font: 18px Arial, Sans-serif;">
<Ecom:OrderGrandTotal DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowWhereOfVATTitle" runat="server" />
</td>
<td></td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalVAT DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
</tbody>
</table>
<web:ValueExists ID="TrackingContainer" runat="server" Name="TrackingUrlInformation">
<OnTrue>
<asp:HyperLink ID="TrackingLink" runat="server" CssClass="tracking-link" Target="_blank"><web:Text runat="server" Name="TrackingUrlText"/></asp:HyperLink>
<div style="padding: 20px 0; font: 14px Arial, Sans-serif;">
<web:Text Name="TrackingUrlInformation" runat="server" />
</div>
</OnTrue>
</web:ValueExists>
<web:ValueExists runat="server" Name="Text1">
<OnTrue>
<div style="padding: 20px 0; font: 14px Arial, Sans-serif;">
<web:Text Name="Text1" runat="server" />
</div>
</OnTrue>
</web:ValueExists>
</td>
</tr>
</table>
<web:Text runat="server" Name="OrderRowQuantityAbbreviation" Visible="false"/>
解决
不确定我做了什么,但最终确实有效。对不起,对于任何处于相同位置的人。