Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have an image button and a gridview . in that grid view I am using checkbox . when I am clicking on that image button without checking any checkbox in that gridview then it should show alert message like "Please select at least one record". i want write a jquery function under "OnClientClick" properties for showing alert message .

Thanks & Regards
Ankur\m/ 11-Sep-12 3:03am    
have you tried registering the jQuery function on the server side using Page.RegisterClientScriptBlock ?

1 solution

You can do like below.
<script type="text/javascript">

    $(document).ready(function () {
        $('#<%=imageButtonId.ClientID%>').click(function () {

            // Write your logic to check the checkboxes are clicked or not, then 
            // below line shows alert.
            alert("Please select at least one record");

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900