OnClientClick and Eval()

3 posts, 0 answers
  1. Amanda
    Amanda avatar
    65 posts
    Member since:
    Sep 2010

    Posted 15 Dec 2010 Link to this post

    I am trying to set confirmDelete to ask if they want to delete a specific vendor.  \

    <asp:Button ID="deleteButton" style="text-decoration:none" CommandName="Delete" runat="server" Text="Delete"
                                        CommandArgument='<%# Eval("VendorCode") + "," + Eval("Vendor") %>' OnClick="vendor_Delete"
                                        OnClientClick='<%#Eval("Vendor", "return confirmDelete(\"{0}\")")%>'
                                     </asp:Button>

        <script type="text/javascript">
            function confirmDelete(vendor) {
                alert("Are you sure that you want to delete " + vendor + "?";
            }
        </script>

    I am getting a The server tag is not well formed.  Can you help me with this?

    Thanks.
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 15 Dec 2010 Link to this post

    Hello Amanda,

    It looks like you need the ASP.NET forums. This is the WinForms forum. Please can you post in the ASP.NET forum as this is where the experts for that live
    Thanks
    Richard
  3. Amanda
    Amanda avatar
    65 posts
    Member since:
    Sep 2010

    Posted 15 Dec 2010 Link to this post

    Thanks.  Sure will!
Back to Top