usercontrols

Best practice when you need two user controls (winforms) to communicate

Extended problem I would like to add a new problem in addition to the original problem specified below. One of the user controls in the application contains a list of objects that I need to access from another user control. How can this be done? (I don't believe the division into controls is very well performed, but I'd rather not chang...

.NET UserControl accept button best practice?

Hi. I have a windows forms app where I have split different functionality into several user controls. I want each of these user controls to have an accept button. Any best practices here? My idèa is to detect which user control that has focus, and than set it in the parent Form. Any other idèas? ...

I've built a ascx control and I would like to be able to keep adding them using Javascript instead of having to do a full call back

I've built a ascx control and I would like to be able to keep adding new instances of it using JavaScript instead of having to do a AJAX callback. Is this possible? I am basically building a web form for a query control and should clause X be filled in, I want to generate a control for the next clause below. I would like to learn how to ...

How can I make property fields and methods i can call from my user controls (ascx)

I have made a basic ascx control which is just a panel with a couple controls. My question is how can I create custom properties I could set for my custom control? (I mean such as custom properties like runat, CssClass, etc...) I would also like to be able to create methods for my ascx that I could call. I tried putting public static met...

postback not raised problem

Hi, I have next situation: I load dynamic controls during on init, and I do correct initialization. I add dynamic control before postback I don't add anything later in load control is loaded and diplayed correctly I press postback and nothing happens Why I really don't know.. I tried everything. So control IS properly initialised. __...

User Control Click - Windows Forms

Hello, I have a custom user control on my windows forms. This control has a few labels on it. I will be dynamically displaying an array of these controls on my form which will contain different bits of data. What I am trying to do is know which user control was selected when I click on it. This works when I click on an empty space o...

In an ASP control how can I get the text in a <Contentemplate> tag in the control code?

Hi, In my page ASP.net page I'm using a custom control like this: <MyNamespace:MyControl runat="server" ID="myControl"> <contenttemplate> This is the text I want to use </contenttemplate> </MyNamespace:MyControl> In the c# code of the control how can I obtain a string containing the text between the <contentemplate> tag (eg. "This is ...

Adding to a ASP.NET user control constructor

Hello, I've created an asp.net user control and I am trying to add logic to the user control's constructor. When I added the constructor to the user control I received an error telling me there were duplicate constructors. I'm assuming asp.net is creating one for me and then creating mine separately. How do I add logic to my User contro...

WPF tutorial for creating a custom usercontrol

I'm looking for a tutorial that explains creating custom usercontrols in WPF. I want to have one control that combines a textblock, a textbox, and a button that launches a common fileopen dialog. I have the layout done and everything wired up. It's works but it's three independent controls. Hopefully there is a tutorial out there that e...

How to allow users to quit out of long-running VBA tasks?

I have a routine that examines thousands of records looking for discrepancies. This can take upwards of 5 minutes to complete and although I provide a progress bar and elapsed time count, I'm not sure I want to encourage folk pressing ctrl-break to quit the report should it be taking longer than expected. A button in the progress bar...

.NET WAP Publish Question - CodeFile included in publish

I am using a Web Application Project to develop some web user controls (c#). In the WAP the user control directive contains the codefile and inherits attributes. When I publish the WAP to the target website. The dll from bin is copied correctly to the bin of the website, the user controls (.ascx files) are copied correctly. When I per...

User Control with Input Parameter - ASP.NET

I have a user control with property (*.acsx.cs): public partial class controls_PersonAccessStatus : System.Web.UI.UserControl { public Person Person { get; set; } protected void Page_Load(object sender, EventArgs e) { } } Is there some way to pass parameter to this control in *.aspx, something like this <% foreac...

How to expose and raise custom events for a vb.net winforms user control

Hello, Please read THIS post. I have the same problem as described in this post but I am trying to do in in VB.net rather than c#. I am pretty sure to do this I have to use a custom event. (I used a code conversion site to get to learn about custom events.) So in the IDE when I type the following: Public Custom Event AddRemoveAtt...

ASP.NET user control in jQuery UI dialog on button click

Hi Using ASP.NET 3.5 and jQuery UI. When a user clicks the "Search" button, a User Control, containing a search form, should be displayed in a jQuery UI Dialog (popup). How can this be done? Thanks in advance ...

Asp.NET Server Control Postback

I have a Control I want to create. Here's a simple example of what I was to accomplish. I want the control to contain a button. Button b = new Button(); b.Text = "Test"; b.Click += new EventHandler(b_Click); this.Controls.Add(b); Now, the control renders fine, the button shows up on the page. The heart of the problem I'm having is...

Unable to use Winforms control because of unresolved dependencies

Problem: I have a WinForms control ('MyControl') with a dependency on myCli.dll, a dll written in C++ CLI. This component is third party (written by another team). myCli.dll has a dependency on myLibrary.dll which is written by yet another party. The control lives in myAssembly.dll, which is a C# controls and resources library. I had...

Strongly-typed ASCX in WebForms 3.5?

I'm looking to get rid of the code-behind for a control in my WebForms 3.5 application. Again bitten by the bug of how it's done in MVC, I'd like to get a step closer to this methodology by doing: <%@ Control Language="C#" Inherits="Core.DataTemplate<Models.NewsArticle>" %> This gives me the parser error you'd expect, so I remembered...

How do I get a custom IHttpHandler to Be Capable of Handling Postbacks?

I am writing a custom HTTP handler to provide an edit form for a grid using existing user controls. Basically, my handler creates the page, form, header, and other controls necessary to be able to render the existing user controls properly and at the end of ProcessRequest, I use Server.Execute to execute the page that was dynamically cr...

Add a user control to a wpf window

I have a user control that I've created, however when I go to add it to the XAML in the window, intellisense doesn't pick it up, and I cant figure out how to add it to the window. I'm pulling my hair out here! Any help is greatly appreciated! ...

Programmatically docking a User Control at Run Time

I need to dock a WinForms user control at run time but I'm encountering an issue. In my main form, I have a menu strip at the top of it. I want to programmatically add a UserControl docked to the left of the main window and below the menu strip. When I add my User control at runtime and then set its Dock property to DockStyle.Left, it...