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 92049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:07:33+00:00 2026-05-10T23:07:33+00:00

I have a CompositeDataBoundControl and im trying to add a ItemCommand to it, ala

  • 0

I have a CompositeDataBoundControl and im trying to add a ItemCommand to it, ala the System.Web.UI.WebControls.Repeater – so like a numpty, I just thought if I reflector’ed and added the code like so, it should work:

private static readonly object EventItemCommand = new object();  protected override bool OnBubbleEvent(object sender, EventArgs e) {     // throw new Exception();     bool flag = false;     if (e is RepeaterCommandEventArgs)     {         this.OnItemCommand((RepeaterCommandEventArgs)e);         flag = true;     }     return flag; }   protected virtual void OnItemCommand(RepeaterCommandEventArgs e) {     RepeaterCommandEventHandler handler = (RepeaterCommandEventHandler)base.Events[EventItemCommand];     if (handler != null)     {         handler(this, e);     } }  public event RepeaterCommandEventHandler ItemCommand {     add     {         base.Events.AddHandler(EventItemCommand, value);     }     remove     {         base.Events.RemoveHandler(EventItemCommand, value);     } } 

Unfortunatly, even though I have the event bound, it does not seem to fire. Iv tried to go down the route of IPostBackEventHandler, but its still not quite right (I can fire an empty event off with no args, but I cant see a decent way to call the OnItemCommand with the RepeaterCommandEventArgs

Any ideas how to get this to work?

Iv been sitting on the office for the last 4 hours trying to get this to work! Help!

  • 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. 2026-05-10T23:07:34+00:00Added an answer on May 10, 2026 at 11:07 pm

    In the case of the Repeater control the RepeaterItem object is actually raising the bubble event and supplying the RepeaterCommandEventArgs:

    protected override bool OnBubbleEvent(object source, EventArgs e) {     if (e is CommandEventArgs)     {         RepeaterCommandEventArgs args = new RepeaterCommandEventArgs(this, source, (CommandEventArgs) e);         base.RaiseBubbleEvent(this, args);         return true;     }     return false; } 

    In case you are not using the RepeaterItem in your control you will probably never get that RepeaterCommandEventArgs. Try checking for CommandEventArgs instead. Also make sure the OnBubbleEvent method of your control is ever called.

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

Sidebar

Related Questions

I have written a Custom Control that contains the following: [assembly: System.Web.UI.WebResource(InSysControls.AssignmentLists.AssignmentLists.js, text/javascript)] namespace
Have just started converting an existing job tracking system into an ASP.NET MVC application.
have been searching for a mod operator in ios, just like the % in
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
I have a custom class: SimpleTemplatedControl : CompositeDataBoundControl private ITemplate _itemTemplate; [PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(typeof(SimpleItem)), ]
have been trying couple of hours now to make my iphone app universal. The
Have a really weird one here. The app has two targets, just to be
I have created a CompositeDataBoundControl that i can databind perfectly well. Now i want
Have piece of code like below: var workStream = new MemoryStream(); var doc =
Have piece of code like below: var workStream = new MemoryStream(); var doc =

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.