Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Checkbox in a repeater not firing event

Posted on 2008-06-17
4
Medium Priority
?
467 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 400 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

Industry Leaders: 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

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

719 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