TargetControl Id for Confirm Button Extender
In one my ASP.NET web page, I have used a G开发者_开发知识库rid and embedded a the Delete buttons inside the Grid as follows:
<ItemTemplate>
<asp:LinkButton ID="DeleteBtn" CssClass="btn green" CommandArgument='<%#Eval("id") %>' CommandName="delete" ToolTip="Delete" Text="Delete"
runat="server" />
</ItemTemplate>
I tried to use a Confirm extender on this Delete button but on running it says "TargetControlId" not found for the cofirm extender. However, the confirm extender works fine of the button is outside the grid. Is there anyway I can apply the confirm extender to the button inside the Grid?
Where did you place the confirm extender code? The ID of the button only exist inside the ItemTemplate container so you have to place you extender inside the ItemTemplate. If you have the extender outside of you ItemTemplate you could do something with the event OnItemDataBound and in the code get the button instance and apply to ConfirmExtender to that instance.
/Viktor
精彩评论