usercontrols

Raising javascript events in ASP.NET user control

Is it possible to raise a "custom event" in an ASP.NET user control and to subscribe to the event in the calling page? This way I can have any containing page react to changes in a user control without having to do a partial or full postback. ...

How do I create a user control that can be sized larger than its created size with WPF

I've created a user control using WPF and I want to add it to window. I've done that, but I can't make my control have a height higher than the height it has in its own xaml file. My MaxWidth and MaxHeight are both infinity, but I can't make the control any taller than what it is in its xaml file. To get around this, I have to make all ...

WinForm Controls for .NET Compact Framework

I'm looking to invest in a UI control toolkit for a Compact Framework 3.5 project for Windows Mobile 5 and later. All I can find is the Resco MobileForms Toolkit (http://www.resco.net/developer/mobileformstoolkit/overview.aspx). I have two questions... Are there any other good WinForm control collections out there? Any experience with ...

Extend System.Windows.Forms.ComboBox

I would like to extend the System.Windows.Forms.ComboBox control with a ReadOnly property, which would display the selected item’s text (similar to a label) when ReadOnly = true. (I do not like the disabled look achieved by setting Enabled=false) How do I do this in winforms? It was really simple in ASP.NET where all I had to do was ove...

UserControl Focus Issue - Focus() sometimes returns false

I have a user control that behaves similar to a tab control. The tab headers are UserControls that override Paint events to make them look custom. In order to leverage the Validating events on various controls on our tab pages, when the user clicks on the tab headers, we set the Focus to the TabHeader user control. I've noticed that C...

Custom properties in XAML of System.Windows.Window

Hello! I've got a very simple WPF UserControl that looks like this: namespace WpfControlLibrary1 { public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); Composite = new Composite(); Composite.Color = Colors.Red; } protected override void OnRender(DrawingC...

How to access properties of a usercontrol in C#

Hi, I've made a C# usercontrol with one textbox and one richtextbox. How can I access the properties of the richtextbox from outside the usercontrol. For example.. if i put it in a form, how can i use the Text propertie of the richtextbox??? thanks ...

Can I create IOC controls using .NET to be placed in web projects?

I currently have a library of UserControls which I use in a lot of our web applications. I would like to update these controls so that I can use IOC to help seperate the logic. So I would have something similar to the following on the web page itself: <prefix:ControlName ID="myControl" runat="server" property="value1" /> And the cont...

How to reference a Master Page from a user control?

I'm looking for a way to (preferably) strongly type a master page from a user control which is found in a content page that uses the master page. Sadly, you can't use this in a user control: <%@ MasterType VirtualPath="~/Masters/Whatever.master" %> I'm trying to access a property of the master page from the user control and would rat...

.NET CheckBox control that supports Value property

I am aware that the default .NET CheckBox control doesn't support the Value property. This seems weird to me because the input control does support value as part of the html spec. So my question is whether or not anyone here knows of a custom user control out there for asp.net that acts similar to the standard ASP .NET CheckBox and Chec...

Exposing an ImageSource property in a UserControl for use in Blend

I have a user control that exposes a property of type ImageSource. I want to expose this property in Blend so that I can edit it in Blend, rather than specifying the image in code. Based on what I've Googled, I've added a dependency property, and specified appropriate attributes to expose the property in Blend. I can see it there, and...

Postback destroys user controls in my GridView columns

I have a ASP.NET GridView that uses template columns and user controls to allow me to dynamically construct the datagrid. Now I'm implementing the event handler for inserting a row. To do that, I create an array of default values and add it to the data table which is acting as a data source. However, when my OnLoad event is fired on post...

Winform - determine if mouse has left user control

Hi all, I am struggling with something that I think should be easily (ish). I have a windows form and a flowgridlayout panel at the bottom of the form. Inside this form I dynamically populate it with X number of User Controls. The controls are all the same type. The goal is when the user hoovers the mouse over the user control it op...

Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

I created a Winforms AutoComplete combobox control inheriting from ComboBox with the following method: Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs) MyBase.OnKeyPress(e) Dim text As String = Me.Text If Char.IsLetter(e.KeyChar) Then text = text + e.KeyChar ...

How do I start a Storyboard in a Data Template in a Content Control in a User Control from codebehind?

PHEW. I'm serious. I'll spell it out as follows... The Storyboard has a Key "myStoryboard". It's held in a DataTemplate with a key "myDataTemplate". This data template is used in a ContentControl with the name "myContentControl" by this tag: <ContentControl Name="myContentControl" ContentTemplate="{DynamicResource myDataTemplate...

Why are children of my custom user-control not being initialized?

UPDATE: I've been experimenting with my controls some more and I think I've gotten closer. Please read on for updated info. I have 2 ASP.NET 2.0 user controls, one of which is placed inside of the other one. Inside of the inner control I have an HtmlAnchor tag control which I'm trying to set a URL for from the outer control. When I atte...

Why is User (as in User.Identity.Name) null in my abstract base controller?

Hello Folks, I was asking a related question but messed the title up and no-one would understand it. Since I am able now to ask the question more precisely, I decided to reformulate it in a new question and close the old one. Sorry for that. So what I want to do is passing data (my custom user's nickname as stored in the db) to the Log...

What's your experience with using ASP.NET 2.0 webparts?

I would like to know your experience with ASP.NET webparts as a reusable component in your website. How useful did you find it? Did you find any serious issues with it? Would you recommend it using in any asp.net project? Any best practices or tips you would like to highlight with respect to this. Would you recommend using webparts ...

Visual Studio 2008 user controls registered in the web.config not registering with intellisense

I have a C# Web application built in Visual Studio 2008 where we rely heavily on user controls for 'pre-built' blocks of ASP.NET. Instead of registering a big stack of user controls on each page, we register all the controls in a local (to a specific folder) web.config file. The advantage is that we can use the controls and the pages lo...

How to Access ASP control located in a user control via JavaScript

Hi All, I'm designing a user control, briefly it contains an asp:hiddenfield control, i'm going to access it via JavaScript function like this function doAnyThing { var myVar = document.getElementById("myHiddenFiled"); } but when I trace my code I found myVar assigned to null, does it matter document.getElementById() method i...