usercontrols

DropDownList OnSelectedIndexChange to 0th index w/out ViewState

I did follow the article TRULLY Understanding ViewState (great article btw) and populating my drop down list is working great. I've even setup a OnSelectedIndexChange event which fires almost as great. The problem I've found is the SelectedIndexChanged event won't fire when selecting the 0th index. It does all other times however. ...

Repeater control - how to add to the item template every x rows?

I have a repeater control outputting some HTML. I want a table which outputs 4 columns and then start a new row (each column will be the next item in the data set). I can do this with inline statements: <% if ((i + 1) % 4 == 0 && i > 0) { //5 items per row%> </tr> <% } %> But I can't seem to i...

Login/Register in Ruby on Rails?

Im starting to learn RoR and i want to make my personal blog in this language. I usually code a couple of prototypes on top of whatever im doing in my blog. So i would like people to be able to log in, and register with their openID. So i was about to jump to the coding place when i realized the concept of gems and all that stuff is giv...

Solution for: Element <element> is not a known element warning in vs2008 when using User controls

I had a VS2008 project that was showing this warning, and I couldn't find a solution anywhere - perhaps my google-fu is weak. In any case, the apparent solution to this is to make sure that the TagName is the name of control class. So for my example, the following displayed the warning: <%@ Register Src="~/path/to/Control.ascx" TagNam...

Free advanced dropdown list control (Windows Forms .Net)

I'm looking for a free advanced dropdown list control. Basically something that provides a dropdown list which can have icons, and multiple bits of text per entry (preferably one large bit of text and then a smaller bit of text underneath). Anyone know of such a control? I've had a look but can't seem to find one. If I can't find it I ...

Retrieving values from winform RTE user control embedded in web

Is there any way to achieve the copy paste image functionality from clipboard using the winform user control in web? Am able to copy paste images from the clipboard, the problem being retrieving values from the winform RTE user control. My requirement being - End user would copy paste some image/text into this control. The corresponding...

Altering windows form from userControl

Hi, i'm quite new with windows forms and i have a small issue. i have a form that contains a userControl. the form also contains a button with enabled = false, and upon some user selection in the userControl sets the button to enabled = true. basically, i want to know what's the best way to change something in the form upon a change in ...

What is the issue with UserControls in XAML / WPF?

I have had major problems with getting UserControls to work in XAML - I have spent hours trying to figure out all the problems but have got nowhere and cannot find where I am going wrong. The main problem I am having is when I create a UserControl for example a simple one which shows an object different colours - I have successfully crea...

How to read a passed parameter in a WPF UserControl?

I created a user control in WPF: <UserControl x:Class="TestUserControl.Controls.GetLatest" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <TextBlock Name="theTextBlock"/> </UserControl> The code behind has a parameter called "FirstMessage" wh...

How do I implement the TabIndex on a user control

I use several user controls, along with standard ASP.Net controls, to build my webform. Standard controls have a TabIndex property that lets me control the sequence in which the controls receive focus. Can I implement this for my user controls? My user controls are visually simple and look like a standard textbox or dropdown list. ...

Set properties on dynamically added UserControl

I'm dynamically adding a custom user control to the page as per this post. However, i need to set a property on the user control as i add it to the page. How do I do that? Code snippet would be nice :) Details: I have a custom user control with a public field (property ... e.g. public int someId;) As I add a UserControl to a page,...

How to enable user to drag/drop WPF user controls anywhere on the page?

Now that I can make useful user controls in WPF (thanks to this stackoverflow answer) I want to be able to put numerous user controls on one page in two columns and enable the user to be able to move them around according to preference, dragging the ones they use the most to the top, etc. Can anyone point me to code, tutorials, etc. whi...

C# Force ListBox to update elements

I'm subclassing the standard ListBox control. I get notified of changes to any of the elements added to the list. The task is to update the text shown by the ListBox for the changing element. I'm aware that i could just remove the changed element and add it again, but this seems not preferable for obvious reasons. ...

Using something like user control to put in the <head> of aspx pages.

Basically I just want something like an include control that I can put into the head and also something that could be nested(optional). I want to put the links to the css and js files in there so I have them all in one place. NO MASTERPAGES - I am trying to(read have to) avoid them for this project. User controls work fine for this but ...

Programmatically adding Javascript File to User Control in .net

How do you add Javascript file programmatically to the user control? I want the user control to be a complete package - ie I don't want to have to add javascript that's related to the user control on the page where it's used, when I can do it inside the control itself. Since there is no Page object in the user control, how would you do...

VisualStudio: How to add the dotted border to a UserControl at design time?

i have a user control that descends from UserControl. When dropped onto the form the user control is invisible, because it doesn't have any kind of border to show itself. The PictureBox and Panel controls, at design time, draws a dashed 1px border to make it visible. What is the propert way to do that? Is there an attribute you can u...

What assembly are ASP.NET UserControls put into?

Classes I create in ~/App_Code are put into the App_Code assembly. If I create the following ASP.NET UserControl: ~/UserControls/BasicUserControl.ascx <%@ Control Language="C#" AutoEventWireup="true" CodeFile="BasicUserControl.ascx.cs" Inherits="UserControl_BasicUserControl" %> Hello world! ~/UserControls/BasicUserControl.ascx.cs u...

In a asp.net webforms UserControl, why do controls need to be protected

On a UserControl in asp.net webforms, Why do the controls within the usercontrol (TextBox, DropDownList, etc.) have to be declared as protected in the code-behind. Is there runtime inheritance occuring with webforms? ...

C# semi-transparent 'LightBox' Control invoking Parent's paint method

I am trying to create a lightbox effect within my application. To achieve this, I have a UserControl with a panel representing the semi-transparent overlay and a seperate panel hosting all the necessary content. When I show this UserControl It often attempts to render itself 2-3 times causing the background to appear to get darker and d...

Asp.Net MVC. Updating user control (Shopping Cart) with Ajax

I want to implement a user control which represents a list of the current items in a user's shopping cart, and which is included from within the a master page. I want to add a product to the shopping cart; the shopping cart should be automatically updated with an asynchronous call (JavaScript framework is jQuery) when a user adds a prod...