usercontrols

how do I create an enum from a string representation? c#

im trying to pass back from a user control a list of strings that are part of an enum, like this: <bni:products id="bnProducts" runat="server" ProductsList="First, Second, Third" /> and in the code behid do something like this: public enum MS { First = 1, Second, Third }; private MS[] _ProductList; pu...

Best 'connection' between MyUserControl.List<NestedControl> and MyUserControl.Panel.Controls

Actually i wrote a UserControl which acts as a container for other (let's call it) NestedUserControls. I implemented a programmatically way to add such NestedUserControls to my UserControl (through an App(string name) function). But what i actually more like would be some kind of List as a public property for my UserControl. But the pr...

WPF ControlTemplate vs UserControl

Hi. I've recently made an UserControl, which took quite a long time, because I had to work with custom Dependency Properties and so on... Anyways, it was just a bunch of 3 controls: TextBox, Popup with Hierarchical Tree. Now I realized I could probably write a ControlTemplate only. Hence what is the benefit of using UserControl? ...

Do not want Error Provider to check control validation until save event

I am writing a User Control. Into each control I am loading a custom biz object. Because the biz object implements IDataErrorInfo interface I am able to use the ErrorProvider control on the user control. I am binding the ErrorProvider to the biz object like this: Me.ErrorProvider1.DataSource=MyBizObject This is all working perfectly...

Why asp.net response is slow

Hi i have deployed one of our asp.net website at windows 2003 server. When i request default page then always first responseof session takes more time. I think due to image rendring/ css and javascript . Is there any way to make response as fast as possible. Also in my default.aspx i am using 6 web parts and 6 user controls one for eac...

WPF - CanExecute dosn't fire when raising Commands from a UserControl

Hi, I've got a button strip usercontrol that I want to have on most of my forms. I've added the commands as follows ... public ICommand Create { get { return buttonCreate.Command; } set { buttonCreate.Command = value; } } I've set these as dependency...

Possible - cancel user control rendering if not loaded in x seconds?

This is probably a lark, but for the recaptcha control as it sometimes takes a long time to render, is this possible? If it takes more than say 5 seconds to render, I'd like to stop the rendering of the object and display my own captcha. I'd start a timer on page load and if 5 seconds has elapsed, in some event in the recaptcha con...

How to load web user controls with interface type

I have a web user control which call some methods of an interface. Four different classes use this interface. public interface IMultiTextProvider { bool Insert(string text, Guid campaignId); IEnumerable<IMultiTextItem> GetItems(Guid campaignId); } In init or load I am setting up the controls like this (where wuc* is a control...

WPF : Binding Order

I have a usercontrol (ItemsView) that I use in one of my other view. Since I need to access its ViewModel, the ItemsViewViewModel is contained by the ViewModel of the view that contained the control. I use this control at many times and I find it useful to bind a collection on the ItemsSource of my ItemsView control (differently, dependi...

Ajax upatepanel on user control, parent's inline style not rendered by IE

Hi, I have a asp.net page, the main content section displays the custom html content from the database. To the right of it, it has a few user control that lets the user make drop down selections and go to its perspective links. So it's something like this: <asp:Content ID="Content3" ContentPlaceHolderID="mainContentPlaceHolder" Runat...

wpf trouble using dependency properties in a UserControl

I made a UserControl that is meant to be updated once every few seconds with data from a serial port. This UserControl should be very simple, consisting of a Label for a field name, and another Label containing the field value. I say that it should be simple, but it doesn't work. It does not update at all, and doesn't even display the...

Make a user control resizable in a tab control.

I am unable to figure out how to make my user control react to the resize event of a form. The usercontrol(s) exist in a tab control of my main form. The usercontrol(s) are anchored to all sides of the tab control or is it tab page? The tab control is anchored to all sides of the form. When I resize my main form the tab control resizes c...

ASP.net dynamically created control event handling

Essentially I have a placeholder added to the page dynamically on page load. Then I have a composite control that is added to the placeholder and displayed during runtime for specific page events. The composite control has a button. I have a public eventhandler for the button available in the composite control, but don't actually have ...

How can I assing the Caret to a Control in WPF

Need to make a new WPF control and give the Caret to it. In WINFORMS or previos Windows UI it was easy using the WIN API Caret functions, but now in WPF we don't have hwnd for each control so... is there a way to do it? ...

WPF UserControl naming convention question

Hi. I'm creating a WPF UserControl with many elements inside. I need to work with them and I need to give them names. I've seen that in some custom controls people are naming elements this way: PART_name Should I name my elements like PART_ListBox.. etc? Or what's the purpose of this? Is it to differentiate that these names are part ...

What can't I access a UserControl from my aspx.cs file?

Hi, I have a default.aspx file and 2 user controls. Code for user control 1 <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> <%@ Register Src="~/WebUserControl2.ascx" TagName="wc1" TagPrefix="asp2" %> <asp2:wc1 ID="control1" runat="server" /> Code for user control 2 <...

Creating reusable UserControl assemblies with VS2008

Is there a recommended process for creating reusable ASP.NET assemblies that contain UserControls that can be shared across projects in separate solutions? We have currently have a set of post-compilation steps that run aspnet_compiler.exe on the project, generate the precompiled assemblies using a given name, followed by aspnet_merge.e...

Can not find project web item (ERROR)

I am using SmartPart (http://www.codeplex.com/smartpart) to add web parts to SharePoint. When I open the *.ascx file with visual studio it doesn't display the design of the control showing the error however it runs well when it is added to share point. But I need to see the design to be able to add controls through tool box visually not ...

Smart Tags: what you can do when a Method in DesignerActionList is invoked?

Context: Visual Studio : C# : Windows Forms : design time : using a custom UserControl that implements Smart Tags which you have placed in a container (Window or Panel) on a Form in your current project : .NET FrameWork >= 3.5 Hi, Pease keep in mind everything I am describing is happening at Design Time. I am clear how to create a Sma...

What is a good pattern for designing widgets in ASP.NET?

There is some desire to add widget-like components to the Default page of our corporate intranet, with things like job search, weather, etc. My original thought was to define the widgets as user controls, with a similar div structure, and use callbacks to communicate between the client and server, and jquery to perform some ui functiona...