Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6383581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:40:01+00:00 2026-05-25T02:40:01+00:00

I have a checkbox in repeater control. on changing it’s bit value, it should

  • 0

I have a checkbox in repeater control.
on changing it’s bit value, it should prompt the alert message like do u wish to delete?
and if yes is selected, the onselectedchange server event should be fired.

Right now. on clicking the checkbox i am using onclick event to fire the prompt but it is not able to fire the server event.

here is my code

<script language="javascript" type="text/javascript">

function CheckedChange() {
         if (confirm('Are you sure you want to delete?'))
             return true;
         else
             return false;
     }
</script>

<asp:Repeater ID="repQuestion" runat="server"  onitemcommand="repQuestion_ItemCommand"                                                    onitemdatabound="repQuestion_ItemDataBound">

<ItemTemplate>
<table  width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<asp:CheckBox onclick="return CheckedChange();" ID="delete" runat="server" Checked='<%#DataBinder.Eval(Container.DataItem, "IsDeleted")%>' OnCheckedChanged="chkdelete_Click" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:40:02+00:00Added an answer on May 25, 2026 at 2:40 am

    Work around this snippet.

    The Repeater.

    <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate>
            <table>
                <tr>
                    <td><%# Eval("Index") %></td>
                    <td>
                        <asp:CheckBox ID="delete" runat="server" 
                                AutoPostBack="true"
                                Checked='<%# Convert.ToBoolean(Eval("IsDeleted")) %>'
                                Enabled='<%# !Convert.ToBoolean(Eval("IsDeleted")) %>'
                                OnCheckedChanged="chkdelete_Click" 
                                onclick="javascript:return CheckedChange(this)"/>              
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:Repeater>
    

    JavaScript

    function CheckedChange(objCheckBox) {
        if (confirm('Are you sure you want to delete?')) {
            __doPostBack("'" + objCheckBox.id + "'", '');
            return true;
        }
        else {
            objCheckBox.checked = false;
            return false;
        }
    }
    

    Page_Load Event

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                //bind gridview here
                DataTable dataTable = new DataTable
                {
                    Columns = { "Index", { "IsDeleted", typeof(bool) } }
                };
                bool temp = true;
                for (var i = 0; i < 6; i++)
                {
                    dataTable.Rows.Add((i + 1).ToString(), temp);
                    temp = !temp;
                }
    
                Repeater1.DataSource = dataTable;
                Repeater1.DataBind();
            }
        }
        catch (Exception exception)
        {
            //Elmah.ErrorSignal.FromCurrentContext().Raise(exception);
        }
    }
    

    Well, I don’t personally like exposing the __doPostBack but this seems to be the only way in this case.

    On an unrelated side note, if you are showing deleted items, its better to show them disabled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Repeater control which contains a CheckBox and a lable control in
I have an Asp.Net repeater, which contains a textbox and a checkbox. I need
I have a checkbox list control on my asp.net web form that I am
I have a checkbox in GridViewColumn which i use for show/change database value. The
T have used checkbox column in gridview. On click of a linkbutton, it should
I have a checkbox who's checked value is bound to a binding source which
how to check and uncheck the checkbox in repeater control using javascript? here i
I'm a tad confused. I have a Repeater which populates a list of Checkbox
I have a repeater with a checkbox inside of it. <tr class=datarow> <td style=display:
I have a Flex repeater that has a complex item template. When a checkbox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.