Коллекция элементов управления не может быть изменена, поскольку элемент управления содержит блоки кода (например, <% ... %и GT;).
Я использую
NumericUpDownExtenderajax tool kit мне приходит следующее сообщение
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
не могли бы вы подтолкнуть свою помощь, чтобы избежать этой ошибки
Что я уже пробовал:
<%@ Page Title="" Language="C#" MasterPageFile="~/User.Master" AutoEventWireup="true" CodeBehind="ProductView.aspx.cs" Inherits="Mypro.ProductViews" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div class="container"> <div style="padding-top: 20px"> <div class="col-md-4 pull-right "> <div class="thumbnail" style="max-width: 480px"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <asp:Repeater ID="rptrImages" runat="server"> <ItemTemplate> <div class="item <%# GetActiveClass(Container.ItemIndex) %>"> <img src="Images/ProductImages/<%#Eval("PID") %>/<%#Eval("Name") %><%#Eval("Extention") %>" alt="<%#Eval("Name") %>" onerror="this.src='images/noimage.jpg'" class="img-responsive "> </div> </ItemTemplate> </asp:Repeater> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> </div> <div class="col-md-4 right pull-right text-center"> <asp:Repeater ID="RptrProductDetails" OnItemDataBound="RptrProductDetails_ItemDataBound" OnItemCommand="RptrProductDetails_ItemCommand" runat="server" > <ItemTemplate > <div class="divDet1 text-center "> <h1 class="proNameView" style=" font-family: 'El Messiri', sans-serif;"><%#Eval("PName") %></h1> <div class="proPrice"><span style="color:navy">جم</span><span> </span><span class="proPrice"><%#Eval("PPriceA") %></span> </div> <p class="proPriceView"><asp:Label ID="LblSellPrice" runat="server" Text='<%#Eval("PPrice") %>' CssClass="proPriceView" Visible="false"></asp:Label></p> <div class="proPrice"><span class="proOgPrice"><%#Eval("PSelPriceAS") %></span> </div> <div style="margin-bottom:10px"><span class="label label-danger" style="font-size:80%;color:white"><%#Eval("DiscAmount") %><span>% OFF</span></span></div> <div ><span >الكميه المتاحه</span><span class=" label label-info"> <asp:Label ID="Lblquantity" runat="server" Text='<%#Eval("Minquantity") %>' ></asp:Label></span><span> </span><span><asp:Label ID="LblUnit" runat="server" Text='<%#Eval("UnitName") %>'></asp:Label></span></div> </div> <div class="divDet1 text-center"> <span style="font-size:18px;font-weight:bold">الكمية المطلوبه</span> </div> <div runat="server" > <asp:TextBox ID="txtQuantity" runat="server" Width="50px" CssClass="text-center" Text="0" type="number" min="0" MaxLength="100" step="1"></asp:TextBox> <ajaxToolkit:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" Minimum="1" Maximum="100" Step="1" TargetControlID="txtQuantity"/> </div> <div class="divDet1 text-center "> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="من فضلك ادخل الكميه" ControlToValidate="txtQuantity" EnableClientScript="true" ForeColor="Red" ></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="ارقام فقط" ControlToValidate="txtQuantity" ValidationExpression="^[0-9]*$" ForeColor="Red"></asp:RegularExpressionValidator> </div> <div> </div> <div class="divDet1 text-center "> <asp:Label ID="lblError" runat="server" CssClass="text-danger"></asp:Label> </div> <div class="divDet1 text-center"> <h5 class="h5Size">وصف المنتج</h5> <p> <%#Eval("PDescription") %> </p> </div> <div> <h5 class="h5Size lead text-center">التوصيل</h5> <div> <div class="text-center"><span class="label label-warning" style="font-size:80%;color:white"><%#Eval("DeliveryName") %></span></div> <hr /> <div><span > لطلبات الجمله </span><sapn><span> </span><span style="color:purple;font-size:18px">01550155665 </span></sapn></div> </div> <div class="divDet1 text-center"> <asp:Button ID="BtnAddToCart" CssClass="mainButton" runat="server" Text="اضف الى مشترياتى" OnClick="BtnAddToCart_Click" /> <asp:Label ID="Label1" runat="server" CssClass="text-danger"></asp:Label> </div> <asp:HiddenField ID="hfCatID" Value='<%# Eval("PcategoryID") %>' runat="server" /> <asp:HiddenField ID="hfSubCatID" Value='<%# Eval("PSubCatID") %>' runat="server" /> <asp:HiddenField ID="hfBrandID" Value='<%# Eval("PBrandID") %>' runat="server" /> </ItemTemplate> </asp:Repeater> </div> <asp:Label ID="Lblmessage" runat="server" CssClass=" control-label text-center Bold_Icon" ForeColor="#FF3300" ></asp:Label> </div> </div> </asp:Content>
Sandeep Mewara
1. Поделиться трассировки стека
2. Обновите также сведения о главной странице