I have a datalist that contains an imagebutton control. I've added an AJAX confirm button extender to this imagebutton, but I want to dynamically change the confirm text depending on the datalist item.
My datalist code is:-
I tried creating an instance of the extender in my onitemdatabound routine, like this:-Code:<asp:datalist ID="dlst_userlist" runat="server" OnItemDataBound="dlst_userlist_ondatabind" OnEditCommand="dlst_remove_user" CssClass="registerform"> <ItemTemplate> <tr><td valign="middle"><asp:label ID="lbl_username" runat="server" cssclass="dblue8" Text='<%#Eval("full_name") %>' /></td><td valign="middle"><asp:ImageButton ID="img_remove_user" ImageUrl="link_doc_remove1.gif" CommandName="Edit" CommandArgument='<%#Eval("linkref") %>' runat="server" /></td></tr> <ajaxtoolkit:ConfirmButtonExtender ID="conf_remove_user" runat="server" ConfirmText='Are you sure you wish to remove <%#Eval("full_name") %> from this task?' TargetControlID="img_remove_user" /> </ItemTemplate> </asp:datalist>
but it says confirmtext is not a member of 'System.Web.UI.Control'. I can't create an instance of the object type within the routine, because it doesn't seem I can create an ajaxtoolkit object, such as Dim username as confirmbuttonextender, for example.Code:e.Item.FindControl("conf_remove_user").confirmtext = "Are you sure you want to remove " & e.Item.DataItem("full_name") & " from this task?"
At the moment if you click the button the confirm text is "Are you sure you wish to remove <%#Eval("full_name") %> from this task?"
I want it to say "Are you sure you wish to remove Joe Bloggs from this task?"
Any ideas how to dynamically change this text?
Thanks



LinkBack URL
About LinkBacks

Bookmarks