usercontrols

How to choose whether a web page should be a web user control?

A few guys on our team are of the opinion that every web page in the application should be a web user control. So you'll have all of your html + event handling in the Customer.ascx, for example, and there will be a corresponding Customer.aspx page that contains Customer.ascx control. These are their arguments: This practice promotes...

Can WPF User Control Detect MouseMovement when Mouse outside of UC Area

hey all, I'm writing a WPF app whereby usercontrols are being dynamically created programmatically in response to an event. The main window canvas has a grid, and i'm adding new columndefs and rowdefs, which contain the new user controls. I need these user controls to keep track of where the mouse is, so that they can respond to event...

ASP.NET ascx vs. aspx - Do you reuse user controls?

Our team is developing a rather big ASP.NET web project which initially startet in ASP.NET 1.0 and was ported several times to all new versions of .NET. We made extensively use of User Controls (ascx). But in retrospect I doubt that it was a good decision. A very small percentage of these controls are reused (resuable) through different...

How to test User Control with unit that relies on the Session object

I'm using ASP.NET to build an application and the latest version of NUNIT framework to test it. I'm constructing a User Control to build a custom menu. That control at some point checks whehter a specific object exists in the Session Collection or not to add some elements to the menu. The exact functionality it provides is this: if the ...

asp.net wiki user control

I'm writing a asp.net web application in which I want the users to be able to apply simple formatting to the text they enter in text areas. One of the possibilities is to use a javascript wisywig editor (like tinymce). However, to keep the text html-clean and readible, I'd prefer that the users have to do the formatting themselves in ex...

User Controls not showing up in the toolbox

I have some UserControls that I created in ProjectA. I have ProjectB that has a windows form that I want to put the controls on. Both of these projects are in a single solution. There's a reference to ProjectA from ProjectB so it can "see" the UserControls. However, the UserControls do not show up in the toolbox for me to drag to the...

How do I get the HTML output of a UserControl in .NET (C#)?

If I create a UserControl and add some objects to it, how can I grab the HTML it would render? ex. UserControl myControl = new UserControl(); myControl.Controls.Add(new TextBox()); // ...something happens return strHTMLofControl; I'd like to just convert a newly built UserControl to a string of HTML. Answered (below): Using azams...

Cannot tab out of databound Winforms dropdown list

This is a bit of a strange one, but I've been struggling for a few hours now and I can't understand what is happening. I was wondering if anyone else has experienced this problem, and can perhaps explain it. I'm building a simple Winforms app and trying to use many of the built in controls. Basically, I've got a form with a user contr...

VB6 How do I add a control at design time without using Drag 'n' Drop?

I'm attempting to create a Wizard type control in VB6 and have run into a stumbling block. I'd like to allow users of the control to be able to add and manage CWizardPage(s) to the design time control using a property page. The first approach I used was to add the Wizard pages to the OCX directly using a Collection, however I ran into ...

Controlling designer appearance of double-buffered owner-drawn UserControl in C#/.NET 2.0

I have an owner-drawn UserControl where I've implemented double-buffering. In order to get double-buffering to work without flicker, I have to override the OnPaintBackground event like so: protected override void OnPaintBackground(PaintEventArgs e) { // don't even have to do anything else } This works great at runtime. The probl...

Determine which button inside a user control sent the event

I have a user control that has several buttons. On page_load, I want to run a method except if a specific button was pressed. When I check the sender on page load inside the user control, I just get the name of the user control and not the button itself. Is there a way that I can determine what button was pressed on page_load? Otherw...

System.IO.FileNotFoundException exception when attempting to drop UserControl on Form in designer

I have created a custom UserControl in Managed C++ that wraps some native code controls. I have confirmed the control works at runtime, and have been trying to make the control work with the Visual Studio designer by allowing drag and drop of the control from the designer toolbox. While I have successfully added the UserControl to the t...

WPF UC in Winforms occasionally has an odd border to the left / visually corrupted

I have a WPF user control I created that is used to show the state of tasks in my UI. I get the odd report back that the control sometimes has a nasty looking border to the left and I cannot reproduce it. The control looks like this (when working) (grey tick=not run, green=OK,red cross=fail,hourglass=running); It looks like this when...

How to implement (UI-wise) a button

I am designing the (G)UI of a program, and have stumbled across a problem; The program will convert a number into different units, and the layout of a unit been cvonverted to is: [Unit name (when clicked gives information)] [Special status, if any][Output in textfield that can also be used for input (to convert to other units)] I want ...

asp.net cascading dropdown with a difference

Anyone know of a control for asp.net that can achieve this either server or ajax. I have a hierarchy of school, division and programme area. Unfortunately this hierarchy has complexities such that a programme area can appear in more than one school. As it is for reporting I would like to give the end user options across each dropdown ...

Binding to an element within a UserControl

Say I have a user control like the one below, how would I bind something to the ActualWidth of the "G1" grid from outside of the control? <UserControl x:Class="Blah"> <WrapPanel> <Grid x:Name="G1"> ... </Grid> <Grid> ... </Grid> </WrapPanel> </UserControl> ...

Google search code in ASP.NET Master Page

I'm trying to put the following Google generated search box code into a Master page on a site: <form action="http://www.google.com/cse" id="cse-search-box"> <div> <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxx:u3qsil-l6ut" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" siz...

ASP.NET Passing properties to dynamically generated user controls

I am struggling on something that, I am sure, should be easy. I have been living in backend and winforms code for a long time, and I'm am building my first ASP.NET page in over a year, so apologies for any noobishness I am inside a User Control on a page. On this User Control (Parent Control) I need to embed 0 .. n child user controls ...

Prism and nested UserControl

I have been using Prism for two days and have successfully added and used existing UserControls on the new Shell. These UserControls contained only pure WPF Controls (buttons, lists etc). I now need to introduce existing UserControls that consists of other UserControls. If my understanding is correct, I believe I need to redevelop the...

Events on ASP.NET UserControl raise every other click?

Yes, there is a similar question here. However, that question doesn't seem to have code attached to it (though it might have at some point; I see answers alluding to code), and the accepted answer (and other advice) on it aren't getting me where I need to be. I have a fairly complex, and frankly not-well-designed VB.NET web app I'm exte...