usercontrols

How to pass data from view to UserControl in ASP.NET MVC?

Say I want to do the simplest of the data passing as follows : <% For i = 0 To 10%> <%Html.RenderPartial("MyUserControl")%> <% Next%> What I want to do is to pass the variable i as the parameter to the UserControl so that it displays the number inside a, say, bordered div. How is this possible? Thanks ...

Creating a custom TabPage control in C#

I'm building a small tabbed c# Form and I'd like each tab page to have some common features, notably, an OK button and an error message and to have a space for the specific form fields. Has anyone else done something similar and how did you approach it? ...

Controls added in the designer are null during Page_Load

All of the names below are generic and not the actual names used. I have a custom UserControl with a Panel that contains a a couple Labels, both .aspx controls. .aspx: <asp:Panel runat="server"> <asp:Label ID="label1" runat="server"> </asp:Label> </asp:Panel> <asp:Panel runat="server"> <asp:Label ID="label2" runat="server"...

Closing ASPxPopupControl and Reset Login Dialogs

I am creating a login usercontrol. I have added the following buttons: Recover Password, Change Password & Edit Profile. I am using DevExpress's ASPxPopupControl to host the functions associated with those three buttons. There are two problems When the popup is opened I need to be able to close/hide it using a command button When a u...

WPF copy paste custom control

I have a custom Hyperlink control. When this control is copied and pasted the pasted content has been converted to a plain old WPF Hyperlink, losing my custom control. Is there a way to specify custom assemblies to be used when the content is serialized to the clipboard during a Copy operation? ...

Winforms TabControl causing spurious Paint events for UserControl

For our project, we've written a WinForms UserControl for graphing. We're seeing some strange behavior when our control is sited in a TabControl - our control continuously fires Paint events, even when there is absolutely no activity by the user. We only see this in the TabControl. When we site our control in other containers such as ...

Selecting a UserControl from XAML

I'm working on a problem right now where I need to embed a UserControl inside another UserControl. But, I need to determine at runtime which embedded UserControl to instantiate. This implies to me that some form of data binding and/or template selection mechanism has to be invoked, but I'm not sure how to proceed with the pure XAML appr...

wpf: usercontrol vs. customcontrol performance issue

Which one is better from performance view user control or custom control? Right now I am using user control and In a specific scenario, I am creating around 200(approx.) different instances of this control but it is bit slow while loading and I need to wait atlest 20-30 second to complete the operation. What should I do to increase the p...

Alternatives to UpdatePanel on a user control (ASCX page)

I am currently working on a ASP.NET AJAX application. Having decided to not use UpdatePanels for evident reasons, what alternatives to I have? This application has pages built dynamically and so most or all the components of the page exist as User Controls. I need to make AJAX calls from ASCX user control page. And as ASCX user control...

User control javascript

Hi, I have a generic user control which will be used twice in a page. There is a javascript asscoiated with it which also needs to be added. How can I add this to a page since the javascript will be added multiple times. ...

Multiple layout UserControl

Hi all, I have a UserControl that manages a lot of editable information (like text-boxes). Now I need to make a version of this control that has a different layout (from horizontal to vertical). I can expose the control, like this: public TextBox MyText { get { return myText; } set { myText = value; } } i...

Silverlight getting opened site

Hi Let's say I have a MainPage that has a button. I also have another page(Page2) that has a textbox. I woud like to add a simple text "TEXT" to the textbox in Page2 while navigating by the button from MainPage. I have a problem with getting actually opened Site. In Windows Forms applications it is solved by: Page2 page2 = (Page2)Appl...

Render a user control ascx

I want to use an ascx as a template, and render it programatically, using the resulting html as the return value of an ajax method. Page pageHolder = new Page(); MyUserControl ctlRender = (MyUserControl)pageHolder.LoadControl(typeof(MyUserControl),null); pageHolder.Controls.Add(ctlRender); System.IO.StringWriter swOutput = new System.I...

Can't override a global WPF style that is set by TargetType on a single specific control

I have a style applied to all my textboxes, defined in a resource dictionary.. <Style TargetType="TextBlock"> <Setter Property="TextBlock.FontSize" Value="{Binding Source={StaticResource ApplicationUserSettings}, Path=fontSize, Mode=OneWay}" /> <Setter Property="TextBlock.TextWrapping" Value="Wrap" /> <Setter Pro...

Share data between usercontrols

On my page I have n-userControls (same control) I need to communicate between them(to be more specific I need to pass one in value) . I don't want to involve the hosting page for that. The controls acts as "pagers" and interact with the paged data on the hostin page via events that hosting page is subscribed to. So when user click on ...

Should I inherit from a stackpanel instead of a stack panel, grid or other UI element or UserControl?

So I'm building a peice of UI that might me in a dialog window or might be in embedded in part of a bigger page. I don't have alot of experience with WPF, but in ASP.NET you always used UserControls, because their wasn't anyt really generic UI inherit to inherit from (and in a way UserControl was just a div). My coworker has written ...

Developing ASP.NET MVC UI Extensions - best approach

What are the best practices in developing rich UI extensions for ASP.NET MVC (I mean asynchronous / partial loading, slick effects, skinning etc) ? I saw that Telerik has an MVC suite of extensions, but haven't tried them yet, so I cannot comment on them. My biggest concern as of the moment is how to structure the code of my extensions...

How to expose a control collection to a property grid at design time

I have a custom control that with a property that is a collection of custom object. This custom object hava a reference to some component/controls. When at design time I tray to add an item to the collection and select the object, VS tells me that the control is not serializable. This is the code (simplified version - but not to much)...

Loading indicators for Silverlight

I'm looking for nice loading indicators for Silverlight. I found a few, but all are terrible. I would like something this - http://preloaders.net/ ...

Redraw and flicker issues

I have an Outlook style app. So basically I have a sidebar on the left and on the right I have a panel control (pnlMainBody) that hosts content. The content is typically a user control that I add to the panel when user clicks appropriate button in the side bar. The way I add the user control to the panel is as follows: // _pnlEmail...