My Imagebutton exists within a ListView object and an UpdatePanel
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ListView ID="ListView1" runat="server">
<ItemTemplate>
<asp:ImageButton ID="btnAttach" runat="server" OnClientClick="update('Clip','false','inc')" ImageUrl="~/Images/Image.png" CommandName='<%# DataBinder.Eval(Container.DataItem, "ID")'/>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
At the ListView ItemCommand event i perform a check to see if a record exists in a database.
If it does not exist, i simply add it.
Now, if the record exists, i would like to show a JavascriptMessage displaying that the record already exists.
Private Sub ListView1_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewCommandEventArgs) Handles ListView1.ItemCommand
If Not RecordExists() Then
InsertRecord()
Else
Show JavascriptMessage (Record Already Exists!)
End If
End Sub
So how could i do that? I tried several different versions of the Show JavascriptMessage, but none worked!