usercontrols

Multiple User Controls referencing the same object.

Hi, I have created a UserControl in C# that I have put a DataGridView on. When I have only one instance of this UserControl in a WinForms project, it works like intended. When I have two instances of this UserControl in a WinForms project, the second instance of my UserControl behaves the way it should but the first one does not. It se...

Failed to load viewstate.

I have an aspx page that dynamically loads user controls: there is an UpdatePanel that holds these controls (one each time). When I change a control with another one it fails with the message: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewst...

ASP.Net 3.5: Specifying a control's HTML ID

I have a control which is repeated several times in a page. I'd like each occurrence to have a unique ID which I will define (not the horrible ID asp.net attaches). The problem is that I will only know the ID in run time. I'd like in the .aspx to write the following: <uc8:MyControl ID="<%=THEID%>" runat="server" /> but I know it does...

Access ASP.NET control from static [WebMethod] (JS ajax call)

Hello! Guys, I need some help. I have a ASP.NET WebSite and a custom control (lets call it myControl) on it. I need to call a method on this control with AJAX. I'm posting ajax call from JavaScript (jQuery) to C# WebMethod. This works fine, but I can't get to myControl in a static WebMethod. Any ideas how to solve this problem? Short v...

Passing user controls as variables.

I am writing what i will call a survey system. The surveys will consist of a series of questions, split into sections. The survey definitions will be stored in a database. The questions can be of various types, that have different input methods and validation (e.g.textbox, numeric textbox, selectlist etc.) I am creating a set of use...

Communicating between controls in a Webpart

We have a webpart that has 2 user controls. We want the second user control to be able to read a value from the first user control. One solution we have considered is an event in the first control, that updates a value in second user control. But not sure where to place / hook up the events so that this works. Anyone have any idea how...

Refreshing an asp.net page from a control in another control

Hello, I want to refresh my asp.net page after someone clicks an "Add" button. However, the "Add" button is part of user control inside another user control and the child control and parent control are both wrapped in Update Panels: Code below is cut short for display, there's a reason the user control is inside another user control In...

How to access ${SRCROOT} in a user script?

I have a user script that I would like to be able to access $SRCROOT in order to get a file that is part of the project but can't see to get it to work. If I create a simple user script as so: echo "${SRCROOT}" with the output set to replace selection nothing is output except the newline. Is there a way to access env vars from user sc...

Java based user authentication

Can someone point me in the direction of a good Java library to use to handle basic user login/authentication. I am looking for a competent I can integrate into a custom app to handle simple user/name password authentication and send account validation/password reset emails. ...

Developing wizard UI - WPF

All in WPF: Developing a wizard application, user has to answer a number of simple questions before brought to the main app. The main app is then prefilled with the information obtained from the wizard. I started with a Window which I then planned to add usercontrols to. The main window would have the user control in the first row, the...

Embedding usercontrols in an assembly

Does anyone know a good way to embed user controls inside an assenbly so they can be reused across projects. I am not looking to create custom web controls. I have ascx files from different projects which I want to centrally use. ...

C# Winforms - Prevent a control from stealing focus when added programatically

Hi there. I have a bit of an odd question. My situation is as following: I have a form, It contains several user controls that in turn contains either other user controls or other basic controls such as TextBox, RichTextBox and such. As part of the logic when editing the text boxes, I create another control programatically and inform ...

Pass a parameter to user control in ASP.NET MVC?

I am looking for a way to pass an parameter to the user control? Right now I have a big if statement and code duplication in my user control. I want to have the loop inside the view and I want to pass the current index of the loop to the user control? // current view Html.RenderPartial("DetailsRateForm", ViewData.Model); // ASP.NET MVC...

Binding a nested object to a usercontrol results in a VERY unresponsive control when using OnPropertyChanged Bindings

I have 2 classes that implement the same interface,A Client And a Spouse Both implement IClientBase,but client actually implements IClient(which extends IClientBase a little bit further),Spouse only inherits from IClientBase. A client class,contains a spouse. I have built a few usercontrols and used databinding so i can bind the client o...

New classes created by users?

Consider this situation: I've got an aquarium simulator where I have 5 different types of fishes. Different types means different attributes (speed, colour, hunger, etc). What if I want the user of my simulator to be able to create a new type of fish and give it its values for its attributes? How is that implemented by the programmer? D...

WPF-like properties with custom controls in ASP.net

In WPF it's possible to set a property of a custom control by either an attribute or by an inner property. Like this: <custom:UserControl1 Text="My text here..."></custom:UserControl1> Equals: <custom:UserControl1> <custom:UserControl1.Text> My text here... </custom:UserControl1.Text> </custom:UserControl1> In ASP.n...

ASP.NET footer control : Links breaking when using across different folders

I have an ASP .NET Website where i have an index.aspx page and 3 Folders along with it.ie;My Root has index.aspx ,FolderA,FolderB and then FolderCommon(these 3 are folders). I have got few asp pages in FolderA and FolderB.FolderCommon stores js files ,CSS files and common code etcc.... I have a user control called pageFooter , inside w...

Tab structure best practices

Hi, When developing a WinForms app that will utilize a tab control to display different sets of data, is it best to add all my controls to the tabs directly, OR create user controls, add my controls to the UC and add the UC to each of the different tabs? I was informed that the UC approach is best practice, and I understand some of the...

TimHeuer's FloatableWindow Issue

Hi, I've some trouble with Tim's FloatableWindow. (<--SourceCode & DLLs) It throws the following Exception once closed the control. Object reference not set to an instance of an object in System.Windows.Controls.FloatableWindow.b__0(Object s, EventArgs args) in System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Dele...

ASP.NET Setting Flash file path for Object tag inside a usercontrol

I have a an ASP.NET user control where i wanto run a flash movie using flashplayer.How can i set the path of flash movie file properly so that this would work in all pages irrespective of the folders. ie; it should work inside a page in FolderA and a page in FolderASub1 which is in FolderA and a page in the Root folder too.My Flash file ...