usercontrols

Trap errors on load for IE embedded UserControl

I have a UserControl (.dll) that is embedded via the object tag in a asp.net page, normally the control loads fine but when it does not it only shows a blank page with a icon in the top left corner. Is there any way to trap any errors or view any error messages during the loading of the UserControl? The visual studio 2008 debugger does n...

How can I re-instantiate dynamic ASP.NET user controls without using a database?

I'm currently working with a part of my application that uses Dynamic Web User Controls and I'm having a bit of trouble figuring out the best way to re-instantiate the controls on postback by using ViewState or some other method that doesn't require me to query a database on each postback. Basically what I have on my page is a user cont...

If I have a inline user control page, are public properties properties on the control?

If I have a inline user control page, are public properties... properties on the control? <%@ Control language=C# %> <script runat=server> public string Title {get;set;} </script> ie. if someone loads the control by tag or programatically, they will see those public properties? ...

base.OnLoad(e) in a ASP.NET page

I might have misunderstood the meaning of base.OnLoad(e); My understanding was that this statement will call the OnLoad method of the base class of the class where it's called from. However, when I use the debugger to step through the code, I see different results. public abstract class BaseUC : System.Web.UI.UserControl { protected...

Invalid Cast Exception when trying to convert a property of a user control in a binding.

I have a user control that has a textbox. I have tried to expose the texbox's Text property by implementing a DependencyProperty with the same name in the UserControl. Thus: public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), ...

C# generics usercontrol

Helo, I would like a stuff like that : public partial class ObjectSelectorControl<T> : UserControl where T : class The problem is that the designer can't resolve this. Someone as a workaround with this ? ...

Text is busting out of the contained box

Hi, I have a user control that displays summary information, and it busts out of the contained box if the text is like: <NOBR>00000000000000000000<wbr/>00000000000000000000...</NOBR> I added the nobr and wbr tags, but it still doesn't force the text to wrap to the next line. The entire row is displayed (with the "..."), so for sure ...

License for components in ASP.NET

I want to create a license system for some components (in DLL format) for ASP.NET , and I have not any ideea of about how to do this thing. I can use the unique series of car (such as HDD's series), so it would be a pretty difficult task. ...

Control without a form in VB .Net

I would like to make an application where there is no form, only controls, this way theuser can see what they are doing on top of their work. How could I for instance put a textbox on the screen, just like form1, but without it being a parent of form1, almost as if it was form1. Basically form1 is hidden. Thanks ...

check if user is logged in in user control Asp.net MVC

how can i check if a user is logged in in user control with asp.net mvc usually on a view page i use this <% if (User.Identity.IsAuthenticated) {%> //Do something <% } %> but i can't get this done on a user control ...

Pros and Cons of registering user controls in web.config vs. asp page.

Can someone please let me know the pros and cons of registering user controls in web.config vs. on top of asp pages? I am looking for performance issues in particular. Does having all the controls registered in web.config make the pages slower to load (even the pages that do not use these controls)? ...

WPF - Handling custom attached events on custom controls

I have a routed event declared as such (names have been changed to protect the innocent): public class DragHelper : DependencyObject { public static readonly RoutedEvent DragCompleteEvent = EventManager.RegisterRoutedEvent( "DragComplete", RoutingStrategy.Bubble, typeof(DragRoutedEventHandler), typeof...

C# usercontrol how to access all child controls

Hello, I defined a custom panel with a table layout panel inside. However when I used this control on a winform I do not have access to the table layout panel properties. (I want for instance add a column or dock an other control in a cell). I try to changed the modifier property to public, but it still does not work. What can I do in o...

Which is faster... XSLT macro or .NEt User Control..

Using Umbraco, which is quicker to load on a page... XSLT Macro or a .NET user Control (via an Umbraco Macro). ...

C#: How to get a user control to properly auto size itself

I have a UserControl which consists of a Label (Top), a FlowLayoutPanel (Fill, TopDown flow and no wrap) and a Panel (Bottom). The user control creates a number of controls, based on a list of stuff it gets, and adds them to the FlowLayoutPanel. How can I get this UserControl to properly resize itself so that the FlowLayoutPanel does no...

C# user control as a custom panel

Hello, I create my own user control which only contains a panel : When I drag a myPanel object in the designer and then try to add a button on it, the button is in fact added to the form's controls. Is there a property/attribute I must set in order to perform this, an other way to do what I want ? public class MyPanel : UserControl {...

Passing values between tabs in AJAX tabcontainer in ASP.net

Hello, I have a ASP.net page with couple of tabpanels. When a user hits submit button when he is on the First tab I am showing the user the second tab control. Ontabindexchanged I am dynamically creating a usercontrol and passing some values to the control. Now when the user is in the 2nd tab and if he navigates to the first tab, I need...

WPF freeform border control

Hi, i have to develop a wpf control which shall have the same behaviour as the well known border. The shape of the control shall be the new part. Every definable closed path shall be used to define the appearence of the control. I need help to achieve this. Currently i have no idea how to interchange the rectangle(??) with the closed p...

C#: Good way of finding the next and previous sibling control

What is a good way of finding the next and previous siblings of a control? So for example if you have a panel with a number of buttons, textboxes, etc in it. Somewhere among those you have a user control which consists of a textbox and a button. When the button is clicked you for example want to find the name of the control that comes a...

ASP.NET 2.0: User-Control in a FormView needs to save user-data (for dummies ;))

Hi, I have developed a user-control which gets bound to an id-field and then enables editing of records from (various) other sources (linked via this id). This is working fine, but I am struggling to save the data when the form is saved - obviously there's more to be done than "just" writing the id back. I wouldn't like to add extra bu...