usercontrols

UserControl events not working for first time

Hello All, I am calling my user control in a web page dynamically. For the first time when I click the button on user control, the event is not firing. When I click the same for a second time, the events are firing.. Can anyone help me? ...

Add row to table at runtime

On one of our pages, we've got a table that has rows generated at runtime. I want to move the content of those rows out into their own control and set properties on it at runtime, in order to separate the presentation from the code-behind. But it's not working the way I'm expecting. If I have my row-like control inherit from UserContr...

WPF: What is the difference between a User Control Library and a Custom Control Library?

I am just coming up to speed on WPF and would like to create a reusable WPF control. When I look at the options for creating projects in Visual Studio, I see "WPF User Control Library" and "WPF Custom Control Library". It's unclear to me what the difference is between them and my Google searches have not turned up any decent explanat...

Why is each control is like a page on its own on our registration page?

For the registration process, we have 5 different pages which the developer jammed into a single page (each of the 5 sections is a usercontrol). Only one control is set to visible at a time. It seems that each control's page_load event is fired at the same time. Is this a design problem or is it expected behavior? ...

ASP.NET: How to initialize when *user control* is initially loaded

I have an ASP.NET user control that I'm embedding in another user control. This works fine. I need to know the best logic/method for detecting when the control is loaded. In other words, I have some display initialization logic that needs to run when the control is initially displayed. Surely there is a pattern for this. The typica...

Using C# WinForms Designer on Panel instead of Form Again?

I have the same question, but the answer to use a UserControl will not do. I also need to create a control container that I can add other controls to at design time so I can add it to yet another container (Splitter Panel) which is not avaialable to me at design time (plugin architecture). When I make a User Control, it is missing the...

Can I place ASP.NET user controls on pages without a control declaration?

I would like to put user controls on pages without registering the tag at the top of the page. For example: <p>some text</p> <myname:mycontrol runat="server" /> Is this possible? I've heard that tag declarations can be done in web.config... is this true? If so, any idea which .NET framework versions support this? Thanks ...

Problems adding a UserControl referencing a C++/CLI wrapper to a unmanaged dll to a form

My UserControl references a C++/CLI wrapper to an unmanaged C++ dll. When I try to add the UserControl to a form, I get a Visual Studio error, which says "Failed to create component 'userControl'", giving a System.IO.FileNotFoundException as the cause. From what I've been able to determine, the problem stems from visual studio not copyi...

UserControl Default Value in Property

I have a UserControl with a few boolean properties in it. I would like them to be set to true by default if not set explicitly in the .aspx page, or at least force them to be declared if there's no way to set a default. I know there is a way to do this because lots of controls have required properties that break your app when you try to ...

asp.net control id's in separate JS file

Hi, I have a custom control with a bunch of buttons and inputs. I also have a JS file where all my code goes for easy debugging. How can I get the ClientIDs of the controls in the JS file? My workaround at the moment is to have a script block at the top of the control and to put all the JS in there. I'd like some separation though. M...

AJAX.Net - UpdatePanel doesn't delete old content

I'm using AJAX.Net (3.5) inside a usercontrol. The usercontrol contains an UpdatePanel, and inside the UpdatePanelthere is a MultiView. The ScriptManager is included in the page that act as container for the usercontrol. To switch between views the usercontrol contains a simple button. When I click it, the View is changed so the old co...

Embedded Form in a control or Form as User Control

Okay I have a large CRUD app that uses tabs with Forms embedded in them like so --> public static void ShowFormInContainerControl(Control ctl, Form frm) { frm.TopLevel = false; frm.FormBorderStyle = FormBorderStyle.None; frm.Dock = DockStyle.Fill; frm.Visible = true; ctl.Controls.Add(frm); ...

Usercontrol display error in C# Designer

I've created a usercontrol in the C# (ASP.NET) designer. It works fine (when I compile / run) and doesn't kick out any errors. I'm using it in a GridView, if that makes a difference. Sometimes, when I'm in the designer (for the page, not the control) it gives me a red box and tells me it can't display the user control. Switching to sour...

Getting namespace name not found for ASP.net user control

So I'm having problems when I try to publish the website. I'm in visual studio 2008 sp1. I've got a bunch of user controls and on a few pages I'm using them programatically. I've got a reference on the aspx page <%@ Reference Control="~/UserControls/Foo.ascx" %> Then on the code behing I use ASP.usercontrols_foo newFoo control = (AS...

How can I refresh a ASP.NET MVC UserControl with jQuery?

Hi everyone! I have a UserControl that binds directly to database, that is, it's not rendered by any Action. It works independly. But, from times to times I have to refresh it to get new information from database. I've already worked with refreshing UserControls in jQuery via Ajax, but in all of these cases, I had a Action to make the ...

Having trouble understanding User Controls in C#

I'm new to usercontrols, having only created one so far, so bear with me. I've been reading today that usercontrols are supposed to be self-contained and not rely on any information from the parent container. I get that part, but what I'm having trouble understanding is the "right" way to design my program around that principle. I'm ma...

Send values from other controls to User Control properties in .aspx page

Is there a way pass values from other controls (e.g. "selected value of dropdownlist", "value from query string") to a User Control using a property within the tag itself and NOT from the code behind? ...

Nesting content in user controls

okay so this is probably a soft pitch question for sombody, but I want to be able decratively drop some content into a control like so: <uc1:floatingControl id="myFloatingControl" runat="server"> <floatingContent> Hello world<br /> <asp:button id="arbitraryASPControl" runat="server" /> <uc2:arbiratryUserControl id="foo"...

Authoring custom controls in COM for Access 2003

Short version of question: How can I author custom controls for MS Access 2003 without resorting to VB6 ? Long Version: I have been spoiled with the pleasure of writing C# WinForms apps for the past 6 years and now I have to modify an Access 2003 application. Yes, it will eventually be rewritten as a Dot Net app, but for now, it mu...

Usercontrol not posting back in IE.

I am using Umbraco CMS to create a new site. I have added a .NET user control for the contact form. However, when clicking submit the page doesn't postback in IE, but it is working in FF. I can't think of why this is the case. I've tried to take all validation controls off and the problem remains. Any suggestions would be great. ...