Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2005, 12:25 PM
Authorized User
 
Join Date: Apr 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to DudeBori82 Send a message via MSN to DudeBori82
Default Custom Control Event Handler Doesnt fire right

I have a custom control that doesn't fire the event handler till the 2nd click.
Code:
protected override void CreateChildControls()
{
    ddlConfig = new DropDownListControl();
    ddlConfig.ID = "_PLATFORM_CONTROLS_ddlConfig";
    ddlConfig.Required = false;
    ddlConfig.AutoPostBack = true;
    ddlConfig.LabelText = "Configuration:";        
    ddlConfig.DropDownList.SelectedIndexChanged -= new EventHandler(DropDownList_SelectedIndexChanged);
    ddlConfig.DropDownList.SelectedIndexChanged += new EventHandler(DropDownList_SelectedIndexChanged);
    PopulateConfigsList();

    //Add Control to Grouping Control, etc...
}
Don't know why, but the first click triggers the postback, but doesn't fire the event handler. The second click does and so on... Does any one know why?

Actions are a direct result of your desires. Desire for good things.
__________________
Troubleshooting life: 1 bug at a time.





Similar Threads
Thread Thread Starter Forum Replies Last Post
LinkButton PostBack handler in custom control Ozzy Bongo BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 July 24th, 2008 07:55 AM
ImageButton wont fire event Moonie112 ASP.NET 1.0 and 1.1 Basics 1 February 11th, 2006 01:01 PM
SelectedIndexChanged Event doesn't fire ddudley3 ASP.NET 2.0 Professional 7 February 6th, 2006 10:47 AM
Custom Validation Control Client side event rodmcleay ASP.NET 1.0 and 1.1 Basics 3 December 17th, 2004 08:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.