usercontrols

Enable PostBack for a ASP.NET User Control

When I click my "Query" button, my TestID textbox TestIDTxt retained its value, but both myDatePicker's are blank without any value. Question: How do I preserve StartDate.SelectedDate and EndDate.SelectedDate between postbacks? Solution: As suggested multiple times, removing ReadOnly="true" on the DateTxt kept the text value across pos...

Is there an easy to use tab control for visual studio 6?

I need to support a legacy vb6 application, and would like to add a tab control. Is there an equivalent to visual studio 2008's tab control? The built-in "TabStrip" control is a pain to use. ...

Access WPF user control value

I have 2 text box in WPF user control and button on WPF form. How can I access those textbox value on the button click event of that main form where I am using the WPF user control ...

Expression Blend: How to create User Control with dynamic headline?

Hi, I created a UserControl and added a "label" asset. I gave this label a default content property. If I include this UserControl in my projekt, how can I achieve to edit the content property in the properties window? I want to have a behaviour like the TabItem: There is a "Header" option under Properties->CommonProperties where you can...

Design support for templated UserControl

Hello, I have created a real simple templated UserControl using the following tutorial: http://msdn.microsoft.com/en-us/library/36574bf6(VS.80).aspx I can now add this control to my mvc 2.0 application using: <components:Box BoxType="Help" Title="Content Title" runat="server"> <Content> <%: Html.TextBox("test") %> ...

calling a method on the parent page from a user control

I am using a user control that I created (just a .cs file not an .ascx file), that does some magic and depending on a value generated by the control, I need it to do something on the parent page that is 'hosting' the control. It needs to call a method under certain circumstances (method is on the parent control). the control is placed ...

Adding a custom control to a page, then adding multiple custom children into that one, null user controls

Hello all, While nerding my way through the day again. I came across a problem concerning adding children to an already add child control. I can add the controls, but when trying to use the controls in the added control, they all return null. This is the method: protected override CreateChildControls(EventArgs e) { UserControl uC...

Paging more than one collection on a single page in asp.net mvc.

I'm building a search engine for documents using asp.net mvc. The results of the search are two different IList collections (One for the people matched and one for the documents matched with the search parameters). I put these collections in a class and return the class to the view. The view uses HTML.RenderPartial() to bind the respe...

What causes markup-controls to be null?

Ok, I have a very strange problem. I have a regular UserControl with some controls in the markup. At Page_Load these controls are still null. And I have tried EnsureChildControls It is laid out like this: Masterpage -> Page -> mycontrol1 -> mycontrol2 -> problemcontrol ProblemControl is where the controls are null. MyControl1 contains...

javascript problem asp.net

I have an aspx page with "step" session that load usercontrols accourding to the "step" session. when step = 1 its loading usercontrol1 when step = 2 its loading usercontrol2 .... .... when step = XX its loading usercontrolXX I'm using jquery in usercontrol1 and the page is working fine but when I'm moving to step 2 and calling to java...

Visual Studio: Design a UserControl class that derives from an abstract base class

Hi All, I want to have an abstract base class for some of my custom UserControl's. The reason is obvious: they share some common properties and methods (a basic implementation of some elements of an interface actually), and I want to implement them only once. I have done this by defining my abstract base class: public abstract class V...

.Net MVC UserControl - RenderPartial or EditorFor

Hi I have a View that contains a usercontrol. The usercontrol is rendered using: <% Html.RenderPartial("GeneralStuff", Model.General, ViewData); %> My problem is that the usercontrol renders nicely with values from the model but when I post values edited in the usercontrol they are not mapped back to Model.General. I know I can find ...

ASP.NET - Nested Custom Templates

I'm thinking about converting a few usercontrols to use templates instead. One of these is my own UC which contains some controls, one of which is a repeater. Is it possible to specifcy a template for the second level usercontrol from the template for the first (which would be on the page)? ...

WPF/MVVM:Set multiple datacontext to ONE usercontrol

Hello, I have a UserControl with 5 small UserControl which are parts of the first UserControl. The first UserControl is datatemplated by a MainViewModel type. The other 5 small UserControls have also set the DataContext to this MainViewModel type. Now I want additionally that those 5 UserControls get a 2nd DataContext to access other...

DependencyProperty Orientation problem

I am learning WPF and am trying to create my first UserControl. My UserControl consists of StackPanel StackPanel contains a Label and TextBox I am trying to create two Dependency Properties Text for the Label Orientation for the StackPanel - The orientation will affect the position of the Label and TextBox effectively I have succ...

WPF MVVM UserControl Binding "Container", dispose to avoid memory leak.

For simplicity. I have a window, with a bindable usercontrol <UserControl Content="{Binding Path = BindingControl, UpdateSourceTrigger=PropertyChanged}"> I have two user controls, ControlA, and ControlB, Both UserControls have their own Datacontext ViewModel, ControlAViewModel and ControlBViewModel. Both ControlAViewModel and Contr...

Nesting a SharePoint Webpart inside of a User Control

I know it's usually the other way around, but I have some extenuating requirements that must be met (read as "No one bothered to do the research and now I have to bail them out") I have a standard user control (ascx) that is to be imported into a SharePoint 2007 website. Due to a design constraint, a sharepoint web part that is also nee...

How can I fix "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."

I have a user control (ascx) that I have added two public properties to: RequestTypeId and GroupId. Both have the Bindable(True) attribute set. In my aspx page, I have a ListView, and in the ItemTemplate, I place my control reference, like so: <asp:ListView ID="lv" runat="server"> <LayoutTemplate> <asp:PlaceHol...

How to implement DisplayMemberPath for my Wpf UserControl?

I'm writing a WPF User Control for my application, wrapping a ListBox and a few other items. The ListBox has a new ItemTemplate that presents four pieces of information for each item in my list. I can hard code each of the four bindings to specific properties on my list items and they display fine. However, I want my UserControl to be ...

C# override WndProc in Control level to detect

I have overridden WndProc in UserControl level to detect MouseDown, MouseUp, and MouseMove to any Control added in that UserControl. protected override void WndProc(ref Message m) { Point mouseLoc = new Point(); switch (m.Msg) { case WM_LBUTTONDOWN: System.Diagnostics.Debug.WriteL...