Questions tagged [dynamic-usercontrols]

Programmatically created instances of any server control

79 questions
0
votes
1 answer

Dynamic Control creation, event handling and control properties in asp.net

I am trying to solve the following issue: I have a user control that needs to be dynamically loaded inside another control. This dynamically loaded control raises an event and as per my knowledge the events raised by dynamically loaded control will…
CSC
  • 1,175
  • 3
  • 11
  • 24
0
votes
2 answers

collections in a UserControl losing contents on postback

I populate a collection in a UserControl which then creates dynamic LinkButton controls from the collection. When one is clicked, on postback, the collection is empty. Is this behavior by design or is there something I can do to keep the collections…
Metaphor
  • 6,157
  • 10
  • 54
  • 77
0
votes
1 answer

ready function inside the dynamically created usercontrol

how can I run $(document).ready(function () { .... function inside the user controlI am dynamically load my use control,what I wanan do is that whenthe load usercontrol,register my some javascript function via ready function. here is the my…
sakir
  • 3,391
  • 8
  • 34
  • 50
0
votes
1 answer

Adding user control to page dynamically

I have a panel that I'm trying to add a user control to from the code behind. The issue is the loaded control does not appear in the panel once the code runs. Am I missing something?
mgmedick
  • 686
  • 7
  • 23
0
votes
1 answer

Passing parameter in User control created dynamically by Ajax duplicate values

I have a problem regarding User control and parameters that I send by the web form using Ajax. I’m using a user control that contains only a Label. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Message.ascx.cs" Inherits="Message"…
Khristian Liahut
  • 195
  • 1
  • 6
  • 24
0
votes
1 answer

Data binding to custom UserControl

So, I have made my own subclass of UserControl, called ChildView (I really can't come up with a decent name), that I want to show inside a container in a window, I have many different kinds of these UserControls and the window must be capable of…
moggizx
  • 476
  • 1
  • 5
  • 19
0
votes
1 answer

Load WPF UserControl dynamically

I have an abstract base class aComponent and sub-classes CriteriaList, Question, etc. For each sub-class I have two corresponding UserControls which have names like ueCriteriaList, ubCriteriaList, ueQuestion, ubQuestion, etc. (ue stands short for…
PGoe
  • 11
  • 3
0
votes
1 answer

How to passing value to an Ext.Net usercontrol and then load it?

.Net Framework v4.5 Ext.Net v2.2 I use UserControlLoader and works fine, but I need passing properties to my UserControl and then render it. my usercontrol markup <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditPost.ascx.cs"…
0
votes
1 answer

Load an usercontrol or page with javascript

Hello it is possible to load an user control or an asp.net page inside another asp.net page with an ajax call?. What i want to do is to show a login box so i need to access also the code beynd of the control from the calling page, i know it is…
sparrows81
  • 431
  • 3
  • 6
  • 19
0
votes
1 answer

WPF Create user control dynamically on change of observablecollection OR Visualize nested ObservableCollections by using nested User controls

I am new to WPF, and I can't find a solution to my problem. I've got an Observable Collection in my ViewModel: ObservableCollection Within the Process class is another ObervableCollection: ObservableCollection I want to add a…
0
votes
2 answers

Programatically Adding A Control - And Accessing it's parameters

I have the following control: public partial class Controls_ProductPanel : System.Web.UI.UserControl { private int _ProductID; public int ProductID { get { return _ProductID; } set { …
gunwin
  • 4,578
  • 5
  • 37
  • 59
0
votes
4 answers

Can Asp.Net UserControls know if they're being added 'late' to the control hierarchy?

I have a user control that uses the standard if(!IsPostBack){//initialize myself} paradigm to avoid re-doing initialization during postbacks (so, trading fewer DB hits for increased ViewState usage). That approach serves me well most of the time…
Dan Davies Brackett
  • 9,811
  • 2
  • 32
  • 54
0
votes
2 answers

Add/remove usercontrol in panorama item using MVVM - Windows Phone

I have a panorama app that has two panorama items so far, "recent" and "popular." These get populated with data using binding from a viewmodel. I would like to add a third ("search") panorama item that initially shows just a text box and a…
Kamal
  • 383
  • 1
  • 6
  • 16
0
votes
1 answer

How to trigger datatemplate selector in Windows Phone?

I have a property and depending upon it's state (say A and B) I either show a usercontrol of animation or a image. Now, if the property changes, I want to trigger the datatemplate selector again. On searching, I found that in WPF I could have used…
-1
votes
1 answer

How to close User Control from its View Model

I created my UserControl like this: MyUserCtrl myctrl = new MyUserCtrl() { DataContext = new MyViewModel()}; ControlCollection.Add(myctrl); and i output it using this ItemsControl ItemsSource="{Binding ControlCollection}" to the View. It's clean…
Fluffy Potato
  • 57
  • 1
  • 10