usercontrols

UserControls Classname-Namespaces issue

I want to change Control(@Control) directive in a way to make it redistributable and want to use ClassName attribute so I changed this From : <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductShower.ascx.cs" Inherits="MyCompany.Web.Controls.ProductShower" %> To : <%@ Control Language="C#" ClassName="MyCompany.Web.C...

Passing information to usercontrol in ASP.NET MVC

hi everyone, I know how pass viewdata into a user control which is like this <% Html.RenderPartial("someUserControl.ascx", viewData); %> This is what i want to do: In the current situation i have events calendar and each section of my events calendar is a wired to a user control, so ideally when i pass a date value to my user contr...

When I instantiate an ASP.NET usercontrol at runtime, why does it ignore the ASCX file?

I've created a regular ASP.NET user control, including the ascx file. For example: MyUserControl.ascx MyUserControl.ascx.cs Then I try to render the control manually, at runtime, using code similar to the following code: var testMyUserControl = new MyUserControl(); var textWriter = new HtmlTextWriter( new System.IO.Strin...

Catching exceptions thrown by plugin UserControl

I am writing a WinForms application that accepts dynamic user interface controls, in the form of plugins (think widgets). For this, the main function of each plugin returns a UserControl that is then added to the main form. Since my application doesn't have direct control over them, I would like to "sandbox" the plugins exception-wise s...

How to autosize User control when it's shown

Hello, I have a Winforms project with a bunch of User controls. I'd like the user control to move itself to be at the 1,1 position relative to its container (whether it's a form or a Panel control). And resize itself to be able to fit half the container. What event can I respond to in the UserControl to be able to do this without any ...

c# hosting a usercontrol in IE

Our web page is only available internally in our company and we am very intrested in being able to offer interactive .net usercontrols on our departments website in the .Net 2.0 enviorment. I have been successful with embeding the object as so: <object id="Object1" classid="http:EmbedTest1.dll#EmbedTest1.UserControl1" width="4...

Dynamically add multiple instances of the same user control type when button is clicked

Is it possible to add instances of the same user control when an "add" button is clicked and maintain ViewState? The user interface here is similar to the Gmail file-attachment process, where the user can click "attach another file" and another file upload box appears. My page is surrounded by an UpdatePanel. I am able to get 1 control...

Nested User Controls - how to best get a reference to an ancestor control

I realize that a whole lot of code cannot fit here, but I am asking for general direction or pointer. I have .NET user controls nested six deep for an interactive gadget with (outer to inner) of : wrapper, tabs, panels, lists, rows, items. I am trying to get a reference to an ancestor control from a nested control. Specifically, I ...

Using two user controls on the same page?

Hello, I have a user control in a master page and the same user control directly in the aspx. The user control in the master page works fine, but when I try the user control that is embedded directly in the aspx page, it doesn't work. The user control is 2 textboxes with a login button. What it looks like it is trying to do is when I...

WPF User Control

I want to have a User Control that takes a collection of People (property "Data") and displays them in a list box. When I run my app nothing shows in the listbox. Can you please point out what I'm doing wrong? Thanks!!! public class Person { public string Name { get; set; } public int Age { get; set; } public override string...

.NET UserControl for CSS columns?

Are there any .NET Controls out there to help with CSS layout and make it nice and easy to quickly make changes - possibly dynamically. Update: I've pretty much give up on this idea as I've researched more about CSS best practices. I've decided to use Yahoo YUI's reset css and grids css to get layouts that can be more easily changed a...

jQuery + MVC User Controls

What I'm trying to do is pass parameters to a user control view which will update a div tag and render the new data based on a hidden user control there. I know how to update a div tag using the Ajax.Form() Helper Method but passing parameters and updating the partial control is beyond me. I've never used jQuery and looked up some tutori...

What are my options for filtering custom .net controls from the WinForms toolbox of Visual Studio 2008?

Visual Studio 2008 does a much better job of detecting and adding controls from projects to the toolbox for use in the forms designer. If you have an assembly with a UserControl- or DataSet-derived type, then it will automatically detect and add that control to the toolbox for designing forms. This is slightly better than the old system ...

What to do when WPF Window doesn't recognize user control defined in the same project?

I have a window "Operation" in XAML that uses a user control "Status" defined in the same project. When I build the solution, it returns ok, but when I open the design view for the Window, visual studio says "Could not create an instance of type 'Status'. The XAML for the Window "Operation" is below: <Window x:Class="TCI.Indexer.UI.Ope...

How to create a specific type of user control

I am trying to create a winForms user control. But I want would like a User control that - when placed on the form -- doesn't take any form space. Instead, it lodges itself nicely below like OpenFileDialog does. First, what kind of user-created thing is this? Is it still called a "user control"? If not, that may explain why all of my se...

How can a descendant UserControl intercept events fired by its base class?

I have a base UserControl (BaseControl.cs) which has an OK and Cancel buttons on it. When the buttons are clicked, an event is fired. Typically other UserControl objects inherit from the BaseControl. Finally the descendant UserControl objects are placed on a WinForm, where they hook into the events for clicking Ok/Cancel buttons. My...

Getting value of a property in Parent User control from a Child user control

I have a ChildUserControl that is loaded inside a ParentUserControl. The host page loads ParentUserControl. I would need to access properties in ParentUserControl from the ChildUserControl. Thanks for your time ...

Enable/Disable table with javascript for multple instances on a single asp age

I just posted one question and got it answered very quickly, thank you. I have a new problem, being I have a asp label which gets text dynamically set on it during instanation and then I have a onmousedown function tied to it call a javascript function to enable a table area that sitting below that is display - none by default. It all ...

Add Multiple User Control of the Same Type to a Page

Similar questions to this one have been asked but none seem to address my exact situation here's what I am trying to do. I have a user control that manages student info. i.e. FirstName, LastName, Address etc. I have a webpage/form that has a button on it. "Add Student". What I want to accomplish is for a new StudentInfo control to be a...

ASP.NET Controls and Generics

can ASP.NET controls be used with generics? Never seen this done and want a way to differentiate some controls on a page by type, ie: DateTime vs int example: public class MyGenericTextBox<T>: TextBox { public MyGenericTextBox<T>() {... } } ...