user-control

Problem drawing graphics to user control

My application pops a form as a child of the main form. On the form is User Control with a Panel where Graphics are rendered. When executed from Visual Studio in debug mode the drawing is often rendered as expected, imagine a simply XY graph. If the panel's graphic aren't drawn then adding two or three break points to the drawing routine...

How to Instantiate User control in Master page cs file

I have added uc in contentplace holder of master page but how do you instantiate the user control in master page .cs file to make it visible when the master page loads ...

How can I detect whether a user control is running in the IDE, in debug mode, or in the released EXE?

I have a user control that I'm building. It's purpose is to display the status of a class to the user. Obviously, this does not matter, and will slow things down when the control runs in the IDE, as it does as soon as you add it to a form. One way to work around this would be to have the control created and added to the controls colle...

Passing data from Controller to a User Control View with ASP.NET MVC

I have a View class (OrderView.aspx) which shows the details of an order (Account Name, Order Date) as well as a list of order lines via the Repeater control. Each order line is represented by a User Control View (OrderLineView.ascx) which shows the details of the order line (Item Name, Quantity, Price). I have a model object called Or...

How to add Application Settings from a custom component (WinForms)

I have a WinForms user control that, when added to a form, should automatically add some elements to application settings. (Of course, the user should be able to customize/disable this behavior.) is that advisable? What is the "good" way to do this? [edit] The control provides a default implementation for the file menu, the consumer on...

ASP.NET: Exposing a Web User Control's controls

I've created some Web User Controls (.ascx files) and dropped them into Pages. The user controls have some TextBoxes in them that I'd like the Page to be able to access directly. What's the easiest (read: least time) way to expose these TextBoxes in the user controls to the Pages containing the user controls? The two options I know are...

how to make User Controls to run on their own thread

how can i make a user control to run on its own thread ? e.g. by following code in a user control , coz user control uses main app thread it make main thread to sleep Thread.Sleep(TimeSpan.FromMinutes(2)); ...

An .ascx user control page opens up as hex?

I am not sure if this is related to this weird behavior I'm experiencing: http://stackoverflow.com/questions/1229811/why-is-my-asp-net-mvc-project-saving-several-copies-of-itself But I'm completely stumped. My solution (asp.net mvc application) currently resides on the thumbdrive (cruzer micro 4gb), all the files were fine as of last n...

Troubles with the SQLDataSource object

Now I know why I just use MySQL and unbound objects... this SQLDataSource thing is for the birds... anyways, since I have to use it for my project, I've got a .ascx user control with a repeater attached to an SQLDataSource object. I'm trying to dynamically pass in a parameter based on a selection in a dropdown box on the parent page. How...

Removing certain properties in a user control, i.e. forcing one value and not editable in Design mode

How can I basically lock a default property so the user cannot edit it? For example, if I wanted to lock the BackColor property, how can I make it so the end user of the control can't edit it? This is in vb.net 2008. Thanks for the help! ...

ASP.NET Dynamically Change User Control Source

The Scenario I have an ASP.Net Web Project that uses a master page. This master page contains a menu in the form of a user control. Sometimes I want to dynamically change this to use a different type of menu user control. The current code to register the user control <%@ Register TagPrefix="chase" TagName="topMenu" Src="~/UserControl...

C# - Hiding all methods of the UserControl class from a derived one

Hi, I have a custom user control. Normally it inherites the UserControl class. But by this way it inherites all the public methods and properties of UserControl. But I want to hide all these and implement my own few methods and properties. Say that I have a custom control named CustomControl. public class CustomControl : UserControl ...

How do I cancel event bubbling in ASP.net?

Is it possible to stop an ItemCommand or control event from bubbling up the control hierarchy? I have a control that contains child user controls that may or may not already have code that handles their ItemCommand events. What I would like to do is to allow the child control to decide to not pass the ItemCommand along to the parent co...

UpdatePanel wrapped around a user control

I have a user control which contains some buttons and a placeholder. Those buttons cause controls to be added/removed from placeholder. Everything works fine. Now I want to put this user control in a page, and wrap it in an updatepanel like so: <asp:UpdatePanel ChildrenAsTriggers="true" ID="UpdatePanelFoo" runat="server" ...

ScriptManager inside ascx page

I have a user control that I use in two different places (hence I created a control). Now, this control uses Web Method that I use to clear session from JS. The only problem is that I don't seem to find a way to include ScriptManager inside the ascx itself - only on the pages that host this control, which is prone to error and defeats th...

How to Convert an ASP.NET User control to Web/Composite Control?

Is there a simple process to convert an user control to a web/composite control? ...

ASP.net user control nightmare

I have implemented a user control that I reuse on several pages. However, I have run into variety of issues such as session maintenance across pages, session clearing on navigating away - essentially control state maintenance, that I am wondering that all this is worth the headache. Every time the page is loaded, a control is added to ...

event when the scroll bars appear C#

How can you detect "EXACTLY" when the scroll bar appears, in a UserControl? perhaps an event or something? ...

WPF: How to create a new class of user control in runtime?

Hello! I need to define a user control in runtime and then instantiate it wherever I want. So it should not be just a "new UserControl()" (that will be an instance of a UserControl class) but the one I can use as a template. Should I use reflection to generate new type or is there a better way? Thanks! ...

User control always crashes Visual Studio

I'm trying to open a user control in one of our projects. It was created, I believe, in VS 2003, and the project has been converted to VS2008. I can view the code fine, but when I try to load the designer view, VS stops responding and I have to close it with the task manager. I have tried leaving it running for several minutes, but it...