usercontrols

ASP.NET UserControls - how do I make a content field accessible from aspx code?

I can't find a good article that solves my following issue, so if anyone has the answer or just a link to the answer I would be happy. Let's say I have created a UserControl called MyUserControl.ascx I reg it in ascx with prefix uc <uc:MyUserControl runat="server" id="uc_test" SomeProperty="true"> <InnerContent> ... Controls added...

Custom/user control

Hello! I have such task - to create control that union two controls (DataGrid from WPFToolkit and standard Toolbar). On a large scale, it doesn't matter what particular controls it unions, I need to find out the common practices that can be used to build what I need. At first glance, I need something like user control, i.e composition ...

Make UserControl remove itself...

Does anyone see anything wrong with this: this.Controls.Remove(this); this is a class which extends user control. When I step through this section of code it looks like everything is fine, however nothing happens to the form. I would expect the control to be gone. Thanks, brian ...

UserControl Textbox Won't Maintain State

I have a very simple usercontrol, basically a textbox and a label, whose purpose is to toggle between one another. The control is bound during the page's Page_Load event. On the UserControl's Page_Load event, I call the Toggle() function, which shows or hides the appropriate control and sets its text based on a boolean Editable property ...

Event not firing early enough in .NET Page cycle

I have a Page (form) that has many UserControls on it, and I'm trying to have a single button to save everything. The UserControls are actually nested, so I wanted to somehow signal to each UC that it should save itself, instead of somehow wrapping everything into one event or having a single event trigger a cascade of save events. My ...

How can I display some text when an embedded object fails to display?

We have some html that looks like this: <form id="MyUserControl" runat="server" method="post"> <script language="javascript" src="javascript.js"></script> The javascript file contains something like this: document.write('<object id="MyUserControl" '); document.write('classid="MyUserControl.dll#MyNamespace.MyUserControl"'); documen...

Web based Image editing and annotation controls for ASP.NET

I am for a control that we can buy to crop and annotate images from an ASP.NET web site. The customer wants to be able to crop, change contrast, etc. AND add shapes (lines, squares, circles, text, etc.) The image quality doesn't need to be all that high. The images are used for "evidence" and are annotated to explain what is going o...

ASP .NET MVC correct UserControl architecture

I'm trying to learn the new ASP .NET MVC framework and would like to know the best practice for using UserControls. I understand that you can render UserControl's as a partial and pass data to them from a controller. Ideally I would think that it makes sense not to have a code behind file as this creates a temptation to break the MVC ru...

WPF UserControl to DLL Programatically

I am generating a WPF UserControl in code that I would like to save as a DLL for use in a different application. The process of saving the DLL needs to be fully automated. Would it be better to try to do this with System.Reflection or by shelling out to csc? Or, is there an even better way to do this? John ...

WPF usercontrol

Hi all, I facing very huge problem now, that is I have usercontrol (created by me) which I have added on to a window... on click of button I wann show another usercontrol on window, total how can I access the window object in my control (usercontrol) Thanks all ...

Using User Controls from Other Projects in ASP

Hello! I'm trying to re-use my ASP User Controls in other projects, and have hit upon a problem. I've read ScottGu's post on http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx and tried to follow his patterns but run-time the child controls of my controls are not being initialised. My setup: I'm using Visual Studio 2008 I'...

How do I share user controls between web applications in ASP.NET?

This question is a follow up to my question about sharing resources between web applications, because I have not yet found a good solution. I have a web application with user controls and resources that are shared by three other web applications. Solution | +-CommonControlsWebApp | +- resources | | +- images | | +- scripts | | +- s...

Failing to add controls to a page dynamically

I'm adding a User Control for each record pulled up in a data reader, here's the basic loop: while (dr.Read()) { ImageSelect imgSel = new ImageSelect(dr["Name"].ToString()); myPanel.Controls.Add(imgSel); } The problem is that there are no controls added to the page, I check the html output and there is my panel, with nothing...

asp.net mvc usercontrol caching

Hi Using MVC 1.0 How can i cache a page but not a user control on it. lets say i have a tag cloud on my master page, tag cloud being a user control that i want refreshed only every x minutes. do i need to do [Donut caching][1]? or has it made it to MVC 1.0 ? can it be done in client browser or only server caching ? [1]: http://ha...

How to easily use complex HTML "templates" from designer in a library user control in ASP.NET (VB.NET)

I have some HTML that I got from a designer, from witch I made a "template" in an .ascx Web User Control about like below. Now I would like to put it into a library. How can I do this in a nice way (Without concatenating strings etc.) (There should be more parameters) <div style="clear:both;margin-top:50px;"></div> <div> <div cla...

Help needed on nested web User Control event in ASP.NET.

Scenario: I have a nested web user controls in my asp web page, and I have a button inside the child user control. Web Page: references a parent control called “slot” which dynamically loads <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="light.Home" %> <%@ Reference Control="~/UserControl/Slot.asc...

How to use User Control properties?

If I make a UserControl, it has numbers properties. How I can use them? My UserControl contained several Shapes and I need to bind a Foreground property to all Shape.Fill. But I do not know how to do it. ...

What type to use to save a set of values in user control's state?

I have a base class for some kind of user controls, and in that base class and in its inherited classes I want to store some properties. I use protected override object SaveControlState() protected override void LoadControlState(object savedState) methods to save or load my custom values. Since I can work only with 1 parameter of typ...

Can I have nested User Controls in ASPnet mvc?

How would I go about this? EDIT: USER CONTROL WITHIN USER CONTROL? ...

ASP.NET Dynamic UserControl ID generation problem

I'm having a problem with the ID property of dynamically loaded UserControls changing during the Page lifecycle. More specifically the ID property changes when the system calls Page.Form.RenderControl(htmlTextWriter); Before it is called the control has ID "ctl84", but after the call it has ID "ctl99". The output from htmlTextWriter con...