<asp:GridView ID="gdvItems" runat="server" AutoGenerateColumns="False" DataKeyNames="fileID" DataSourceID="DSUploadedItems" CssClass="mGrid" AlternatingRowStyle-CssClass="alt"> <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle> <Columns> <asp:TemplateField visible="true" HeaderText="Price"> <ItemTemplate> <asp:DropDownList ID="ddlBuyPrice" runat="server" AutoPostBack="True" Font-Size="11px" Height="22px" OnSelectedIndexChanged="ddlBuyPrice_SelectedIndexChanged" SelectedValue='<%# Bind("buyPrice")%>'> <asp:ListItem Value="0.00">Select:</asp:ListItem> </asp:DropDownList> <asp:LinkButton visible="false" ID="lnkPaymentMethod" runat="server" CausesValidation="False" Text='<%# Bind("acceptPaypal")%>' > /></asp:LinkButton> <br /><br /> <asp:Label ID="lblSoldStatus" visible="false" runat="server" CausesValidation="False" Text='<%# Bind("sold") %>' /> <asp:Image ID="imgSoldStatus" alt="Sold Status" runat="server" width="100px" ImageUrl="~/files/images/icons/iconSold.png" /> <br /> <asp:UpdatePanel ID="upPnlControls" style="margin-top:0px;" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"> <Triggers> <asp:AsyncPostBackTrigger controlid="imgPaymentMethod" eventname="Click" /> </Triggers> <ContentTemplate> <asp:ImageButton visible="true" ID="imgPaymentMethod" runat="server" CausesValidation="False" width="50px" onclick="lnkPaymentMethod_Click"></asp:ImageButton> </ContentTemplate> </asp:UpdatePanel> <br /> <asp:Label ID="lblDateBought" runat="server" CausesValidation="False" Text='<%# Bind("dateBought") %>' /> <asp:LinkButton ID="lnkMarkAsSold" runat="server" OnClick="markAsSold_Click" Text="Mark As Sold" Visible="true" ></asp:LinkButton> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
Protected Sub lnkpaymentMethod_Click(sender As Object, e As System.EventArgs) Dim imgPaymentMethod As ImageButton = CType(sender, ImageButton) Dim currentRow As GridViewRow = DirectCast(imgPaymentMethod.Parent.Parent, GridViewRow) If imgPaymentMethod.ImageUrl="~/files/images/icons/paypalIcon.gif" Then imgPaymentMethod.ImageUrl="~/files/images/icons/cashIcon.gif" Else imgPaymentMethod.ImageUrl="~/files/images/icons/paypalIcon.gif" End If End Sub
Quote:A control with ID 'imgPaymentMethod' could not be found for the trigger in UpdatePanel 'upPnlControls'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)