usercontrols

How can I raise a parent event from a user control in WPF?

I have a user control that is loaded into the parent window, and I want to raise a parent event when a button on the user control is clicked. How can I communicate with the parent through my user control in WPF? ...

How to use margin as property of WPF usercontrol?

How to use margin as property of WPF usercontrol? public Double pCusSPAge { get { return btnCusSPAge.Margin.Left; } set { btnCusSPAge.Margin = new Thickness(value); if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEve...

Raising an event on parent window from a user control in .NET C#

The title pretty much explains the question. I have a user control loaded into the main window when the application is first run. What I want to do is to raise an event on parent window when a button on the user control is clicked, so how can I raise a parent event from button1_Click on the user control? ...

ASP.NET - Load user control using AJAX?

Hi all, I'm not sure if what I'm trying to do is possible - pretty much I just want to call a user control using AJAX and get the rendered html of the control. However, when I try and fetch the control I get the following error message: This type of page is not served. Description: The type of page you have requested is not served bec...

Dynamically adding usercontrols to an update panel

Hi there, Can someone point me in the right direction of adding usercontrols to an update panel. Basically I have a usercontrol that is setup to capture a persons education details. I want to have a button inside the update that when the user clicks loads the usercontrol below the previous usercontrol. Any help would be great. I have...

how to unlock an ASPNETDB user account after bad password count lockout?

i'm new and using the login control with the ASPNETDB visual studio generated user database i set a maximum bad password count of 5 in web.config and tested to the point that an account was locked out. i am however unable to figure out how to unlock the account now. this problem is on my remotely hosted site, so this isn't something i ...

User Control not loading when container panel is invisible...

Hi, I have a usercontrol which has a combobox inside it. This UserControl is the inside an asp panel - and when the panel is visible, the dropdownlist within the control binds to its datasource and behaves itself. When the panel visibility is set to false, the dropdownlist within the usercontrol is empty. Any help appreciated. thank...

Load UserControl via https in Asp.Net

Hello, i'm creating an Asp.Net application and i need to load an UserControl via https. So, in my page i'm loading it with the following code: ... <%@ Register src="../../pages/controls/bar.ascx" tagname="bar" tagprefix="uc1" %> <html> <body> ... <uc1:bar ID="bar1" runat="server" /> ... </body> </html> Here the UserControl is correct...

How would I add jquery, css, etc. from my HEAD into a aspx user control?

I have a page with this in the head <style type="text/css"> #columnList { list-style-type: none; margin: 0; padding: 0; width: 95%; } #columnList li { margin: 0 3px 3px 3px; padding: 0.1em; padding-left: 1.5em; font-size: 1.4em; height: 18px; } #columnList li span { position: absolute; margin-left: -1.3em; } .column { ...

WPF ComboBox Bound to Collection of UserControls Not Showing Selected Item's Text

I have a ComboBox that is bound to an ObservableCollection of custom UserControls. Each user control has a Tag value set and the ComboBox' DisplayMemberPath is set to "Tag". This correctly displays the Tag of each UserControl in the drop down list when the ComboBox is clicked, however when an item in the list is selected and the drop dow...

ASP.NET Custom Control - DataBinding

I have my custom control inside of a formview. This custom control has a variety of properties one of which is Value which I am trying to databind. Using Container.DataItem I can databind my control, and everything works: <fc:Literal runat="server" ID="readState" Label="State:" Value='<%# Container.DataItem("ActivityState") %>' /> T...

Limit resizable dimensions of a custom control (c# .net)

I am making a user control in MS Visual C#, and there is one thing that I just can't find an answer to: How do I limit which dimensions a control can be resized in during design view? For a clear example of what I'm asking, the built in TrackBar control can only only be made wider, not taller, and only displays the resizing squares on ...

Navigating a WPF Tab Control from within a User Control ?

My WPF application consists of a main window with a tab control which has a series of tab items, each hosting a user control. I'd like one of the user controls to be able to trigger the application to change focus from the current tab to a different one. Is there a way for the user control to trigger its tab control container to chan...

MVVM-Light Locator Pattern and Reusable UserControl

I have an existing Silverlight 4 application that I am attempting to convert to use the locator pattern and the MVVM-Light library. My understanding is that the MvvmLocator class keeps a reference to each view model and allows you to bind the DataContext of each view to an appropriate ViewModel in the locator. My application uses a nav...

.NET website: Get the output of .ascx from jQuery

In MVC .NET application we can easily use PartialView to print the output of an ASCX file. For example, I have Book.ascx file, I could have this in the controller public ActionResult Book(int id) { BookModel model = new BookModel() { bookId = id }; return PartialView("Book", model); } which returns the output of Book.ascx Is the...

OnClick event on compound UserControls

I want to create a UserControl with several controls inside. These controls should behave simmilar to the radio buttons, i. e., the status of one of them affects the status of the rest. To do that I would like to be able to handle the OnClick event on each of the controls from the parent. One solution could be to call a method of the pa...

When I drag and drop my user control onto the design surface, it is showing up as a LINK?

Has anyone seen this. Ive done this before and its not been a problem, but now I am trying to drag and drop and it keep showing the files location in a link... ? ...

Data is not getting displayed in WPF User control when used in an application.

Hi, I have a user control - with 2 grids and 4 buttons...buttons used to add/remove values between the grids. There are two properties in this(which i defined in view-model)..."SourceGridData" and "DestinationGridData"...i have implemented onPropertyChanged for these properties. I use this user control inside my wpf application....and...

ASP.NET MVC User Control - Where to put the CSS specific to a control?

I am getting ready to code a bunch of ASP.NET MVC User Controls. All those controls are UI and require CSS. What are the best practices for that? Should I have one gigantic CSS file with the code of all controls? Ideally, I would like each control to have their own CSS file. Is it possible to do that? Thanks! ...

User Controls and strongly typed data

I am trying to pass a strongly typed object to a UserControl, but I am not able. I must be missing something. So my User Control expects an object of type Data which contains a list of string. On my page, I call RenderPartial with the name of my user control and the data. However, when the page run, it says in that this.Model (or this.Vi...