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

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

Custom WebControl - Defined Nested Controls

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :.NET Framework
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

View Complete Post

More Related Resource Links

Nested Custom Controls Events not firing.


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           <

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 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 ?

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=&

Sign outgoing body from client with custom endpoing behavior defined in code

I'm trying to sign (and sign only) the body of every outgoing message that uses this custom endpoint behavior.  When I first created this it was for signing a custom SOAP header.  We are moving away from that and going to just sign the body.  We have some applications that have 10+ web service references.  We don't want to touch the reference.cs for anything.  Below is the code I had before for signing the custom soap header.  I'm trying to modify it to just sign the body.  My modified code is below, and the error I get. Private Class CustomHeaderBehavior Implements ServiceModel.Description.IEndpointBehavior Public Sub New() End Sub Private Sub AddBindingParameters( _ ByVal endpoint As ServiceModel.Description.ServiceEndpoint, _ ByVal bindingParameters As ServiceModel.Channels.BindingParameterCollection) _ Implements ServiceModel.Description.IEndpointBehavior.AddBindingParameters Dim body As New Xml.XmlQualifiedName("Body", "http://schemas.xmlsoap.org/soap/envelope/") Dim BodyMsgPartSpec As New ServiceModel.Security.MessagePartSpecification() BodyMsgPartSpec.IsBodyIncluded = True Dim requirements As ServiceModel.Security.ChannelProtectionRequirements = bindingParameters.Remove(Of ServiceModel.Security.ChannelProtectionRequirements)() requirements

Nested controls in UserControl return null (FindControl)

Hi everyone, I have a very weird issue. I have a UserControl that has some controls inside. I want to refer those controls after, in another postback. But when I try to get them the ".Controls" property of my controls returns null. I'm working on vs2008 Here is the sample code: public partial class MyUserControl : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { foreach (Control control in this.Controls) { Response.Write(control.ClientID); } } private void MyTable() { Table table = new Table(); TableRow row = new TableRow(); TableCell cell = new TableCell(); CheckBox check = new CheckBox(); check.ID = "theId"; check.Text = "My Check"; check.AutoPostBack = true; cell.Controls.Add(check); row.Cells.Add(cell); check = new CheckBox(); check.ID = "theOther"; check.AutoPostBack = true; check.Text = "My Other Check"; cell = new TableCell(); cell.Controls.Add(check); row.Cells.Add(cell); table.Rows.Add(row); this.Controls.Add(table); } protected override void Render(HtmlTextWriter writer) { MyTable(); base.Render(writer); } } And in the Default.aspx is like:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.cs" Inherits="Tester.Default" %> &

Developing custom controls literature

Hi, I'm looking for some literature which focus on developing custom controls in WPF. It should explain how to develop custom controls in details. It should tell me how to chose which control is the best start point for developing custom control which fits my needs. Next, for example if my new custom control need to be inherited from ItemsControl which methods I should override and what is their purpose, what else I should do etc. What do you recommend? Thanks in advance. Nikola  

Custom panel - missing design time support for controls.

I’m trying to implement a custom panel, one that will behave kind of like the standard Canvas panel. The implementation is done and it is working when I add components in the xaml, but what is not working is move and resize of components in the designer. In the designer each component shows the ‘selected frame’ when selected, but it cannot be moved or resized. Can someone point me to what I’m missing, or an article that describes how do add this support?.   The reason I’m not deriving from the existing Canvas is mainly because I want to understand how it works and how to implement it manually.   Thanks  

Issue accessing textbox controls nested within a DetailsView within an UpdatePanel

I have a couple of textboxes nested with a detailsview, within an updatepanel.  When I try and access them from the code behind, it returns a null value as if they don't exist.  Can't figure out why that would be.ASPX code is: <asp:UpdatePanel ID="upSpecificShout" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" > <ContentTemplate> <asp:DetailsView ID="dvSingleShout" DataSourceID="sdsSingleShout" runat="server" AutoGenerateRows="false" OnDataBound="SetDVIcons" HeaderStyle-CssClass="noDisplay" > <EmptyDataTemplate> <p class="Watermark"> The panel on the left shows a list of everything you've shouted. (Your replies to other shouts are highlighted in blue/green.) </p> <p class="Watermark"> This right hand panel will show specific shouts with a list of replies etc.. Just do a little click on a shout title to display more detail here. </p> <p class="Watermark">

Issue with Custom Controls

Hi,we are facing a page loading  problem with custom controls only IE browser. but that the same page open on mozilla firefox 3.5.  we are using all the controls on the page are custom controls. I pasted on custom control code bellow, please verify that is it written proper or not...  using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Web.UI.Design; using System.IO; using System.Configuration; using System.Web.UI.WebControls.WebParts; using System.Drawing.Design; using System.Data; namespace Ays4.Web.UI { #region class CustomizeTextBox [ToolboxData("<{0}:CustomizeTextBox runat=server></{0}:CustomizeTextBox>")] [Designer("System.Web.UI.Design.ReadWriteControlDesigner, System.Design")] [PersistChildren(true)] [ParseChildren(false)] public class CustomizeTextBox : WebControl, INamingContainer { #region Attribute private validateType.ValidationType _ValidationType = validateType.ValidationType.None; private TextBoxType.Mode _Mode = TextBoxType.Mode.None; HtmlTable mainTable; string strJs = ""; private TextBox _inputControl; strin
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