usercontrols

Asp.NET: UserControl's BubbleEvent not being handled by repeater or page

I have a user control inside of a repeater. The user control has an ImageButton, which when clicked, should raise an event to the page which will handle the event: //Button onClick event in user control protected void btnOpenOption_Click(object sender, ImageClickEventArgs e) { RaiseBubbleEvent(sender, e); } The following are two ...

Web.config register user control in another proyect

Hi, I have a .Net project called: Whatever.Web.UI: I use this proyect to put all the custom and user controls that will be reused in all the website projects. These are organized in two folders: - CustomControls folder (with all the custom controls) - UserControls folder (with all the user controls) This are future examples o...

How do I pass data from a controller to a strongly typed user control in asp.net mvc?

I have a strongly typed User Control which should show a user's orders on all pages, it's included in a master page. I have an OrdersController which can give me the current orders and is used at other locations. How do I tell the UserControl in the Master Page that it should get its Data from that specific Controller / Controller Actio...

Current line in a multiline textbox

Hi, I've got my own custom TextBox control, wich inherits from System.Windows.Forms.TextBox. I've overrided OnKeyDown method, because I want to select the previous or next control if the user press either up or down keys. Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs) MyBase.OnKeyDown(e) ...

ASP usercontrol allignement

Hi, I have a ASP UserControl that looks like this: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication2.WebUserControl1" %> <table> <tr> <td> <asp:Image ID="Image1" runat="server" Width="100" Height="100" ImageUrl="~/Logo.png" /> ...

ASP.NET: generate property value when adding control to page

Context: ASP.NET 3.5 / C# Hi, I created a user control public partial class MyControl : UserControl { // EDIT: example first used "UniqueId" as property name, which was wrong. public Guid MyId { get; set; } // ... } and this example usage <uc1:MyControl ID="myControl" MyId="443CBF34-F75F-11DD-BE2F-68C555D89123...

ASP.NET: Pass value from User Control to page?

I am creating a user control in ASP.NET (using VB) that uses the autocomplete ajax control on a textbox to get a value. Then I want the page to post back and run some code according to whatever value is passed to it from this control. Problem is, I'm not exactly sure how to do this. I'm sure it's easy and I should know, but I don't. Th...

MVC RC How to configure UserControl without codebehind?

In the RC without CodeBehind, how do i wire up the ascx with the View if I am passing a model to it? MY CSS CLASSES ALL SAY UNDEFINED. ...

Code Generation for All CLR supported language using a CodeDomSerializer

Hi All, I am implementing Code Generation for WindowsForm control at Design-Time, using a Custom CodeDomSerializer. Here is what I have. A user control i.e. MyControl written in C#. MyControl has a property MyControlProperty of type ObjectXXX that is accessible publicly.(like myControl.MyControlProperty). The type ObjectYYY has a...

WPF Bind DataTable to repeated user controls

I'm in the process of teaching myself WPF, and I have run into a small issue that I can't find the answer to. My test app allows image files to be dropped into a StackPanel. Once an image is dropped, a new user control is added to the stack, and displays some meta-data about the file. All is working correctly, and I can iterate throug...

Help with Zend ACL

hello, I am currently working on a site that requires use of ACL and seen as I am using Zend it makes sense for my make use of there ACL class but I have little to zero idea of how to do this, I have read the docs but this has confused me further...basically all I want do is set up two user groups e.g. normal and admin, normal users ca...

VB.Net Winforms User Control Variable

Hi, I'm using VS 2005 in a VB.Net WinForms application. I have a custom User Control that requires a variable to render its data correctly. My question is, what's the best way to require the calling sub to populate the variable? I've thought of a couple of options: Have a WriteOnly property and check to see if it is "Nothing" when ...

Put custom control Strings into application resource

I have a custom winforms control (inherits from Component) that has some strings displayed to the user. How can I make these strings accessible so the user of the component can customize them, and - if he wants - easily put them into a resource for localization? I thought of exposing them as browsable properties so they can be customi...

How can I get my user control to know when the parent hears the user controls OnHide event?

I have an asp.net page with a task bar on the side. Clicking a task opens up a user control for that task with some controls and a close button. How do I run some C# code when that user control is hidden by clicking the close button? Much of the stuff on the control is surrounded by an update panel and I'll just say right now that...

HowTo write a recursive Custom Control in WinForms .NET

I am attempting to write a 'User Control' in WinForms .NET (not ASP.NET). The control is relatively simple. It will contain a label, a button, and a DataGridView. However, the control needs to be able to instantiate itself, i.e. when the user clicks the button (of the parent control) at least 1 nested (children) control of the same ty...

Creating web user controls from ascx.cs

I am trying to create a instance of a user web control from the code behind of another user web control. using ASP.NET; placeholder1.Controls.Clear(); module_userWebControl_ascx slModule = (module_userWebControl_ascx)LoadControl("~/module/module_userWebControl.ascx"); placeholder1.Controls.Add(slModule); Are...

How can I get an overridden Text property of my user control to show up in the form designer in VS2005?

I have a user control with the following code in it. [System.ComponentModel.Category("Appearance")] public override string Text { ... } private int myVar; [System.ComponentModel.Category("Appearance")] public int MyProperty { ... } MyProperty shows up in the property grid when the control is inserted in a form, but Text does not. Ho...

Adding controls to User Controls dynamically

Hi, I want to add a control to a user control in an event handler (like a button click event). I'm trying to add a datagridview lookup control dynamically, but I couldn't get that to work, so I tried just adding a button with this code: private void btnCreateNewButton_Click(object sender, EventArgs e) { Button btn = new Button(); ...

Caching a user control in ASP.NET ??

I have created a user control in my application "header.ascx", I am pasing a selectedMenu attribute to this control on which the control selects the selectedMenu value specified. Suppose, I have passed value "home" or "search" then it will select (highlight it) the search menu. I want to cache this control, When the value of the selecte...

Insert dynamic controls into diddle of controls collection

Hello folks--this is my very first post! I'm pretty desperate so I'm going above and beyond my standard googling. I believe this is an advanced or expert-level .NET question. The problem is that I have built a .NET web application that needs to be able to insert user controls dynamically into the middle of a list. I'm quite comfortable ...