.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Nested Custom Controls Events not firing.

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net

I have checked and could not find an exact problem like this so hope I didn't duplicate a post.


I have two custom controls. I have ControlA which can take multiple of itself and then ControlB which occurs only once per ControlA but no less. ControlA has a button to load an instance of ControlB and to display it. ControlB has TextBox's DropDownlist and Button who all need to fire events for it to accomplish its tasks.


1    <ctrl:ControlA Id="ca1" runat="server">
2       <ctrl:ControlA Id="ca2_1" runat="server">
3           <ctrl:ControlA Id="ca3_1" runat="server">
4               <ctrl:ControlB Id="cb3_1" runat="server">
5           </ctrl:ControlA>
6           < 

View Complete Post

More Related Resource Links

Custom WebControl - Defined Nested Controls

I have seen the answer to this but am unable to nail it down.  I am looking to extend the WebControls class and want to define the Child Controls that will be placed under the parent.  If i remember right it is a Attribute attached to the class but, again, i am unable to find the reference. If someone could assist me in either pointing me to the correct attribute class or an address that supplies the relevant information, i would greatly appreciate it. This is a broad-spectrum question, not just related to Web development but also desktop.Nothing but something

Nested control's events not firing in UserControl


Hello I have a weird issue. I have a user control which I load dynamically using LoadControl. In this UserControl I have a button with assigned OnClick event, but when I click that button, the event is not fired. I'm populating the user control in UpdatePanel's Load event (I invoke __dopostback from JS).

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ServiceInput.ascx.cs"
Inherits="uPay.UserControls.ServiceInputs.ServiceInput" ViewStateMode="Disabled" %>
    <div class="PopupFoot">
        <asp:Button ID="btnAdd" CssClass="PopupADD" runat="server" OnClick="btnAdd_Click" />

    protected void btnAdd_Click(object sender, EventArgs e)
        //Method never gets called :/

 Here I load user control in the page

protected void ServicesUpdatePanel_Load(object sender, EventArgs e)
        string arg = Request.Params.Get("__EVENTARGUMENT");
        if (arg == "ServiceInput")
            int serviceId;
            if (Int32.TryParse(hdnSelectedService.Value, out serviceId))
                using (Entities db = new Entities())

.Net custom user control buttons (events) not firing in Jquery Modal Popup


I have a custom control, that has takes some information from user and submit to the database. it is working fine in normal aspx pages. but when i display that custom user control in jQuery modal popup. The events does not fire or lets say the data is not submitted to the database.

any help on that?

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

Wicked Code: Craft Custom Controls for Silverlight 2


If you're unfamiliar with Windows Presentation Foundation (WPF), building that first Silverlight custom control can be a daunting experience. This article walks through the process.

Jeff Prosise

MSDN Magazine August 2008

UI on the Fly: Use the .NET Framework to Generate and Execute Custom Controls at Run Time


Creating UI controls on the fly can be accomplished via run-time code generation. And there are lots of reasons to do so. Generating these controls once and then reusing them as needed is more efficient than generating the controls each time. Read on.

Morgan Skinner

MSDN Magazine December 2005

ASP.NET 2.0: Personalize Your Portal with User Controls and Custom Web Parts


ASP.NET 2.0 introduces a Web Part control that is designed to deal with the serialization, storage, and retrieval of customization and personalization data behind the scenes. In this article, the authors explain how you can put the WebPart control to work in your ASP.NET 2.0 applications.

Ted Pattison and Fritz Onion

MSDN Magazine September 2005

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

Custom controls and ViewState management issue



I want to know that when we create custom controls, then is there State Management through ViewState done automatically or we have to handle it explicitely ?Since i have created Custom Controls that is behaving as if it is not maintaining its state on PostBack.

How to add designing in Custom Controls ?


Hi ,

I am trying to create Custom control. I have created simple TextBox, Label, Buttons  etc. and added my own logic for their working,  but i want to add  some designing to that controls.I tried to add CSS file for that from the Add New Item, but there is no list for CSS. 

I added forcefully but it is not supporting CSS files.It seems that Custom controls does not support designing and layout through CSS.

Can you tell how can i polish my controls with beautiful designing and layouts ?

Update web form using custom events.


How can I update UI of web form via event?

I have 2 buttons on page, where button1.visible = false.

Page code behind:

     protected void Page_Load(object sender, EventArgs e)
            if (!this.IsPostBack)
                Class1.ShowButtonEvent += new Class1.ShowButton(Show);

Creating Custom SharePoint 2010 Field Types and Controls with Visual Studio 2010 and Silverlight 3

Learn how developers can create rich experiences in SharePoint Server 2010 publishing sites using Microsoft Silverlight 3.

Video: Creating Custom SharePoint 2010 Field Types and Controls with Visual Studio 2010 and Silverli

Watch the video that accompanies the MSDN article and learn how developers can create rich experiences in SharePoint Server 2010 publishing sites using Microsoft Silverlight 3.

Cannot set custom attributes on mobile controls in this page



I am beginner at mobile Pages with ASP.NET. And i want to make an application with contains  a few TextBox that have different size.

it's my sample code here:

<%@Page Inherits= "System.Web.UI.MobileControls.MobilePage" Language= "C# " %>
<%@ Register TagPrefix= "Mobile" Namespace= "System.Web.UI.MobileControls " Assembly= "System.Web.Mobile" %>
<Mobile:Form runat="server" id="form1" Paginate="true" >
<Mobile:Panel Paginate="True" runat=&

DesignView Events (Custom control)

Is it possible for a custom control to detect design view events such as: Controls added/removed Source/Design view mode change Tabs being opened/closed All I can see is one event and thats the custom control surface being clicked. Look forward to your replies :)

Login contained within a LoginView Events firing?

Hi there,   I'm in the process of trying to figure out how to program in ASP.Net. My senario is this: (A) I've created a master Page (B) In The master page I have a Login Control that is contained in a LoginView control. I cannot figure out how to get the events to fire when it's in this sitution. Any help would be good. If the Login control is situated on it's own the events (LogginIn etc) will fire? 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend