composite-controls

How do I properly handle the viewstate of a child control within a composite control?

I have a composite control that contains a ListBox child control. On postback, the items for the ListBox disappear. I have a property for the ListBox that initializes it, and I add it to the controls collection in CreateChildControls. Am I doing something wrong? Do I need to be doing something else to properly handle the viewstate of thi...

Why should I create my child controls in CreateChildControls() on a CompositeControl?

Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well. My control is a composite "container/collection" control. It will be fed with an object and based on that objects data it will create a number...

Setting AssociatedControlID on label fails

I have a composite control that adds a TextBox and a Label control to its Controls collection. When i try to set the Label's AssociatedControlID to the ClientID of the Textbox i get this error Unable to find control with id 'ctl00_MainContentPlaceholder_MatrixSetControl_mec50_tb' that is associated with the Label 'lb'. Ok so a little...

Adding a script with ScriptManager on a CompositeControl?

I'm trying to call my good old 'RegisterClientScriptBlock' on the friendly 'ScriptManager' class. It just doesn't work for my CompositeControl? I use it on a normal usercontrol (ascx) where it works. Visual Studio simply won't accept me typing 'ScriptManager' or i get "The name 'ScriptManager' does not exist in the current context" if ...

Expose OnSelectedIndexChanged event in CompositeControl

If I have a DropDownList control that makes up part of a CompositeControl how can I expose the SelectedIndexChanged event to the consuming aspx page? Thanks ...

Error Creating Control - Custom Control

I have a custom control and it works fine...except that the control cannot be rendered on Design Time. ( I am using VS 2008) I am thinking many people who develop custom controls encounter this problem...The error I get is "Error Creating Control - CustomControlName" Object reference not set to an instance of an object. I want a work ...

MaskedEditValidator DisplayMoney doesn't show up in Composite Control

I'm creating a simple composite control that has AJAX functionality. When trying to implement a MaskedEditValidator, the DisplayMoney property doesn't work. The MaskedEdit renders, without the dollar sign attached. Any ideas? Here's my code: protected override void OnInit(EventArgs e) { base.OnInit(e); priceTextbox.ID = this.ID ...

Building a composite control with nested items

My goal is to create a composite control that looks like, acts like and behaves like a RadioButtonList. There is some extra things done behind the scenes which are working no problem. What I am unable to accomplish is the desired markup to use the control. My ideal markup looks like this: <cc1:RadioButtonField ID="rfCardType" runat="...

How can I have an ASP.NET templated composite control?

I am trying to add a template to a simplified composite control containing a Label and a TextBox. I want my mark up to look something like this: <test:FormItem ID="fi" runat="server" Title="MyTitle" Text="My Text!"> <TestTemplate> <i> <%# Container.Title) %></i> <br /> <%# Container.Text %> <...

How to store nested CompositeControl properties in ViewState

I have a composite control that has a large number of properties that can be used to style the control. I want to group these properties yet still maintain some of the properties in the ViewState The markup for the control would look like this: e.g. <cc:Test id="test"> <Toolbar Items="add,delete" Enabled="true" /> <Grid Enable...

How to stop CompositeControl TabIndex property from setting tabindex on container span

I wrote a custom server control that inherits from CompositeControl. When the control is instantiated, I am dynamically adding a TextBox to its Controls collection. I have overridden the TabIndex property so that when it is set, it applies the value to the TabIndex property of the child TextBox control. The problem is that when the Co...

The Taligent Programming Model for .Net

Has anyone created a control architecture using the taligent programming model as follows? http://www.wildcrest.com/Potel/Portfolio/mvp.pdf The question is how do you implement or map the IInteractor concept (Page 9) to a .net interface? Currently the guess is to use the IInputElement interface as a the event source for all UI input co...

Force Event to Fire Internally

Hi, In a composite control, how can I make an event fire internally? Ie. I populate with some data, see that it's in the right condition (only one item) and then fire off my item selected event, calling the source page's OnItemSelected event. Thanks, ...

How Do I Utilize An SWT Horizontally Scrolled Composite Using GridLayout?

I have an plugin that displays a composite with a horizontal scrolled bar. I can't figure out how to get GridLayout() to position each widget one row, one after another. If the number of widgets exceed the composite width, you should be able to scroll right to see the rest of the widgets. The horizontal scroll bar appears, but has no ...

Hiding Control Attributes in ASP.Net

Hello I am building a composite control that is composed of an Infragistics WebDataGrid, an add Button, and some ModalPopupExtenders. I want design-time usage of this composite control to be as simple as possible. Meaning, as soon as they type not want there to be any AccessKey, EnableTheming, and all of those completely irrelevant prop...

Multiple instance UserControl's child events aren't firing.

I've written my first UserControl in ASP.Net. It is a user editable ListBox. It contains a ListBox, a HiddenField, a TextBox, and three Buttons (add, remove, and save). Add and remove perform javascript edit of the ListBox and stores the changes in the HiddenField. The save button posts back to the server, causing the HiddenField Val...

Is it possible to add a UserControl to a Composite control?

I'm trying to build a CompositeControl that's flexible. Depending on some of it's parameters, I would like my CompositeControl to load different user controls in it's CreateChildControls method. The exact UserControls aren't know at design time. Just as a quick example, I tried with a "hard coded" UserControl and it failed: protect...

How to give a C# handler file as a url to jquery autocomplete

I am creating a custom control in asp.net . In the control itself i have to call the url for getting results for autocomplete. But both .aspx, .ashx file format are not supported by class library. Is there any other format for substituite of the above to redirect inside the class library. ...

ASP.NET Composite Control raise event to parent form

Say I have a composite control in ASP.NET (C#) which includes a drop down list. I need to be able to bubble the event back to the parent form so that other code can be executed based on its SelectedItem. How do I expose the OnSelectedItemChanged event to the application? Do I need to create my own delegate and raise it when the intern...

Validator Disappears on PostBack Inside Composite Control

This should be a simple problem to fix, as it uses the same way I fixed my last problem with FooControl (below). Basically, I want to add a derived validator I made to this composite control. It works fine but on postback it just disappears in the markup, making me think it's lost its ViewState. I am probably doing something wrong with...