usercontrols

asp .net events in dynamically loaded controls ( Telerik )

Hi Everyone ! I've a question about dynamically loaded controls and events in these controls ( button click in my case :) Here is what i got one RadPanelBar a Button and hidden input: <telerik:RadPanelBar ID="languagesPanelBar" runat="server"> </telerik:RadPanelBar> <asp:Button ID="Button1" ru...

How can I get the parent page from a User Control in an ASP.NET Website (not Web Application)

Just as the subject asks. Thanks! EDIT 1 Maybe it's possible sometime while the request is being processed to store a reference to the parent page in the user control? ...

WPF: template or UserControl with 2 (or more!) ContentPresenters to present content in 'slots'

Hello, I am developing LOB application, where I will need multiple dialog windows (and displaying everything in one window is not an option/makes no sense). I would like to have a user control for my window that would define some styling, etc., and would have several slots where content could be inserted - for example, a modal dialog wi...

How to make UserControl to use master page placeholders?

Hello all. There's quite weird issue and I wonder if it had ever occurred before. It looks odd that nobody had been caught by it, by Google says so. that's what we have: Master page Masterpage.master blahblagblag User control whose page is bound to mentioned-above master page According design, we need to define from .ascx user ...

Does ASP.NET MVC Has Anything Equivalent To WPF's DataTemplate Feature?

In my ASP.NET MVC project, I have a polymorphic collection that I wish to render - say, an IEnumerable<ISomething> where the individual items may be a mix of different implementations of ISomething. I'd like that list rendered, where each concrete type renders according to its own template (perhaps a strongly typed ViewUserControl). In...

Limit the size of a user control at design time

I have a namespace Company.UI.Forms where we have a form base class BaseForm that inherits from System.Windows.Forms.Form. I need to limit the size of this form, so that if a concrete form, say ExampleForm, derives from BaseForm, it should have a fixed size in the VS designer view. The fixed size should be set or defined in some way (i...

View Models (ViewData), UserControls/Partials and Global variables - best practice?

Hi I'm trying to figure out a good way to have 'global' members (such as CurrentUser, Theme etc.) in all of my partials as well as in my views. I don't want to have a logic class that can return this data (like BL.CurrentUser) I do think it needs to be a part of the Model in my views So I tried inheriting from BaseViewData with these m...

.NET UserControl: Size property gives incorrect value on Resize event

Excuse the code dump, these are functions within a UserControl private void PNGQuantPreviewControl_Resize(object sender, EventArgs e) { createOffScreenBm(); draw(); } private void createOffScreenBm() { offScreenBm = new Bitmap(this.Size.Width, this.Size.Height); offScreenGfx = Graphics.FromImage(offScreenBm);...

ASP.Net User Control

I'm trying to build an ASP.net user control that uses a Repeater to iterate over a number of items in an ObjectDataSource that I need to pass in to the user control. I'm not sure how to pass the object data source in though. Any one know how to do this? ...

ASP.NET How do I add javascript function to a control?

I have some user controls that I want to add some client side functionality to. Let say 1 control has a hidden field and a bunch of checkboxes. When a checkbox is checked, it sets the hidden field to 'YES'. How could I $get that control in the hosting control or page, and call some function on it that would return the value of that hi...

UserControl working in one page but not in others

Hi, I've posed this problem previiously also here. I'm facing same type of problem again. I've a user control that shows information from some business object. I'm already using it on two pages. In both the pages I call a method with business object to bind controls (mostly asp labels) on user control to object's properties. I call this ...

ASP.NET LoadControl Use of keyword 'base' is not valid in this context

Hi, I want a web service to load an .ascx control, load some values in it and then return the HTML content of this control. I have something like that: [WebMethod(EnableSession = true)] public void GetHTML() { UserControl loader = new UserControl(); MyCustomReport reportControl = (MyCustomReport)loader.LoadControl("~/The...

Custom User Control in C#...Right Click Menu to Copy Text (Java Developer learning C#)

I'm working on a custom user control that essentially displays a name value pair (name is on a black background, value on a white). I have my control displaying correctly, even showing up in Designer and on my build page. What I'd like to do from here is have the ability to right click on the user control and have a menu come up that ha...

How to send variables from one user control to another without using session?

How to send variables from one user control to another on the same asp.net web page during a postback without using session variables? Hidden fields could be an option, anything else? ...

Creating container usercontrol with design time support in WPF ?

Hi, I want to create a container usercontrol with design time support in WPF ? How can I do ? ...

How do I autosize a silverlight 3 usercontrol based on its contents?

Using Silverlight 3 I am trying to recreate the class object visualization as seen in Visual Studio's class diagram. However, my objects will represent database objects rather than class definitions. I have been partially successful as seen in the following two images. Both of these have been created with fixed sizes, and so they ...

Activate Trigger from Foreign Control

WPF newbie here so excuse the simple question. How do I cause a trigger to fire on a UserControl from a control outside of that UserControl? Here's what I want to do... I have a UserControl with a trigger set to display a background color change on itself when IsMouseOver is True. If I mouse over the UserControl, the trigger fires as...

How can I avoid properties being reset at design-time in tightly bound user controls?

I have UserControl 'A' with a label, and this property: /// <summary> /// Gets or Sets the text of the control /// </summary> [ Browsable(true), EditorBrowsable(EditorBrowsableState.Always), Category("Appearance") ] public override string Text { get { return uxLabel.Tex...

Serving custom user controls on webpages: How come all of my DLLs aren't making it to the client?

Hi all, I have a UI hosted on a webpage. I'm able to run the control on the server hosting it, but when I attempt to run it from other machines on the intranet, only some of the required DLLs make it to the client. What direction can I take to investigate why this is happening? ...

XAML - get user control position relative to whole window as binding property

I'm new to XAML, so please be aware my question may contain some topic misundrestanding. Is it posible to bind XAML usercontrol global (relative to window) position to check if it's currently visible on screen? Usercontrol is inserted inside ScrollViewer and I think on something like: <UserControl x:Class="Test.MessageControl" ...