Solved

Checkbox in a repeater not firing event

Posted on 2008-06-17
4
465 Views
Last Modified: 2008-08-13
I have a checkbox in a repeater.  I need it to call my event handler in the code when the user clicks on it.
I tried onlick & onserverclick events with no luck.

<input type="checkbox" id="chkBox1" runat="server"  onclick="OnClickCheckBox"

event handler:
protected void OnClickCheckBox(object oSender, EventArgs oEventArgs)
{
   int x=0; << does not go here!
}
0
Comment
Question by:ramrocket
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:margajet24
ID: 21819111
aren't you suppose to use ASP controls?.. and not HTML elements?..

i think if you want to handle the event, use javascript..
0
 
LVL 10

Accepted Solution

by:
margajet24 earned 100 total points
ID: 21819170
<asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack=true/>

    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
        // code here
    }

---------
enable AutoPostBack
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question