composite-controls

ASP.Net CustomValidator in a CompositeControl

I present to you a little mystery... the following control is intended to fail validation every time, no matter what, but it does not: public class Test : CompositeControl { protected override void CreateChildControls() { Controls.Clear(); CreateControlHierachy(); ClearChildViewState(); } void C...

Create 'Style' property on CompositeControl in ASP.Net

Hi I'm having a problem creating a new CompositeControl. Currently I have a custom control that inherits from TextBox, the control DOES NOT have the Style property defined, but I can set the property in the page Markup and the style will be applied correctly. I'm trying to create a CompositeControl with the same functionality as the c...

Creating ASP.NET composite control. How to apply properties associated with SkinID?

I am creating a custom composite control based off of an asp:Label control. I'd like to be able to have the label's default properties be skinable as well as additional properties that I add to my control. But when I add a skin definition to the Default.skin file in my themes directory, and add the control to my page with the SkinId sp...

How to manually force VS2008 Intellisense to search for controls in an assembly?

I have an assembly and a namespace registered as composite controls in web.config in . It takes awhile for VS2008 to search through the assembly for the controls. How do i force visual studio to automatically search for the controls? ...

Difference between a WebControl and a CompositeControl?

Hello! I have been looking around on the web and found some articles about the topic, but i still can't figure out the difference between them. I have the code show below, if i inherit from a CompositeControl it works perfectly but not if i inherit from a WebControl. (They both render the code, but only the CompositeControl handles the ...

CompositeControl and XML Deserialization on design-time error.

I get "Error rendering control" error that only happens when I place the control on the webform in desgin-mode, if I run the page the control is displayed correctly. The above statement is not important, this error happens because the returned toolbars object is null. After debugging, the problem is in a function that is called from Ce...

Error Rendering control - [A] cannot be cast to [B] in the context LoadNeither

I am working on a composite control and this requires me to open multiple Visual studio IDEs and add the control on pages. This causes Visual Studio to create multiple assemblies. So every time this happens I close all IDEs, and delete ProjectAssemblies folder. Can all this be avoided? It's very hard to work like that... UPDATE: T...

How can I change child controls in a composite server control on postback

I have an ASP.NET web form composite control, let's call it control A, which contains a child composite control, which I'll call control B. The child controls of control B are dependent on a property of control A. On initial load I am setting this parameter in OnLoad of control A and everything works fine with the control B setting up i...

WPF TabIndex in a composite control

I have a simple window with a simple composite control embedded within it. (Main Window) <Window x:Class="TabOrder.Window1" xmlns:local="clr-namespace:TabOrder" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <L...

ASP CompositeControl & ScriptManager

I'm really new to the WebControl / CompositeControl world, and I have a small test class I am playing with. It's just a LinkButton that updates when clicked. Things work great when I leave it out of UpdatePanel. But when I try to run it inside I still get a full page POST response. How can I make this class work inside a UpdatePanel? H...

DropDownList within composite control is losing selected value on postback

I am building a composite server control that currently only has a TextBox and a DropDownList. Here is the code in all its foetal glory: public Address : CompositeControl { private string[] _states = new string[] { string.Empty, "ACT", "NSW", "VIC", "QLD", "SA", "WA", "NT", "TAS" }; private TextBox _street; p...

Text-property of my ASP.NET Composite-control doesn't set text-changes

Hello, I have build a composite control which renders a TextControl or a RADEditor control, dependable of a property a set. Both rendered controls have a Text-property. The problem is that when I change the Textvalue on my webpage (when it is running) it won't set the new Text-value but the old Textvalue instead. Does anyboy know what...

Converting listview to a composite control

The link below shows a listview composite control in its most basic form however I can't seem to extend this to what I'm trying to do. http://stackoverflow.com/questions/92689/how-to-define-listview-templates-in-code My listview has 1 tablerow with 2 fields. The first field contains 1 element whilst the second field contains 2 elements...

How to convert a DataPager in a Composite Control

I'm trying to convert a datapager that references a ListView all inside a composite control. The ListView correctly displays the full list so now I need to reference a pager to it. But for some reason the datapager isn't being displayed or paging the ListView. Also the DataPager must use an OnPreRender method to databind the ListView to ...

Composite control property that allows coder to select from options

The question is in the title but to make it clearer when you use a normal server control like <asp:textbox /> <CC1:CtrlArticleList SortBy="Title" ID="compositeControlArticleList" runat="server" /> the properties of textbox allow you to select from a dropdown list (eg visibility=...true or false). How do I replicate this in composit...

Correct order of overrides for a composite control based on an abstract one

I'm writing a set of C# composite web server controls for displaying dialog boxes. I want to have one abstract class which handles the basic layout and things like titles of the control, then have a set of derived ones which render child controls at a specific point. I forsee three distincts methods: renderOpeningHtml handled by the ab...

Persisting a collection backed by viewstate in a CompositeControl

Maybe it's been a long day but I'm having trouble persisting a collection backed by the ASP.NET ViewState in a CompositeControl. Here's a simplified version: public class MyControl : CompositeControl { public Collection<MyObject> MyObjectCollection { get { return (Collection<MyObject>)ViewState["coll"] == null ? ...

Add ability to provide list items to composite control with DropDownLIst

I'm creating a composite control for a DropDownList (that also includes a Label). The idea being that I can use my control like a dropdown list, but also have it toss a Label onto the page in front of the DDL. I have this working perfectly for TextBoxes, but am struggling with the DDL because of the Collection (or Datasource) component...

ASP.NET CompositeControl with child controls that are containers

I am building an ASP.NET server control which extends CompositeControl. I need fine grained control over the rendering, so I override Render() and output the child controls myself, interspersed with HTML generation code: writer.AddStyleAttribute("float", "left"); writer.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div); writer.Render...

Adding jquery into a composite control

I am creating a composite control that has a textbox and uses a jquery plugin to add a watermark. Lets say I have a basic function that looks like this $(function () {$('#MyTextBoxID').watermark('Enter your username');}); Can anyone suggest what I need to do to insert the above? TIA! ...