Dynamic Slave Controls - Dynamically add and remove controls without a dispatch control?

I am working a solution to enhance slave controls. I have created a proof of concept based on the 2.04 code base that shows how to load slave controls without switching to the admin view. I have included a sample module that contains 3 view controls. Each control has a row of buttons that can be used to load one of the other 2 controls. (and no I am not using panels.) The default control has a drop down of other instances of the dynamic control that exist on the current tab. Using the module communicator you can raise an event from one control that tells another instance of the module what control to load

I used the access dataprovider so all you need to do is create a virtual directory called DNNSwap
*What doesn't work.
-The module action menu doesn't work all of the time after swapping controls
-Edit module properties - This does not work, if you set it you will need to remove the control and it
*Why do this
-more complex modules could benefit with the ability to interact with other controls on a tab, Yes they can currently do this but only the default view control can. Currently if a slave control is loaded it is loaded into the admin skin and other controls are not available.
I have provided an example HERE
I have provided a more in depth discussion HERE

5/12/2004 9:26:45 PM
asp.net.dotnetnuke-framework 1237 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 17

Awesome. Sadly I lack the time to play much in this area, but I think I can add some ideas to solve at least one or two of the issues. Time is short though, but hopefully this weekend ill get to DL your work and apply a few things I've been messing with and see if they help.

Keep it up! This is greatly needed research.
John Laroche


magicModules Custom DNN Design and Programming

5/13/2004 3:54:44 AM
Hi bert,

this is something I've always wanted to do. I'll take a look at yor discussion.
The main reason/profit I see in the behaviour is what I call don't loosing context. If you have a module highly related to it's surrounding modules it's very nice having the option to don't swicth to a 'slave edit control' and load all controls without loosing it's neighbours.
I've always think of such an improuvment to Dnn, in where you could choose for each control how it should behave.
Nice try bert.
5/21/2004 12:34:15 PM
Vicenc and John,  thanks for taking the time to check it out.  I havent had too much time to work on it latley put think I have figured out a few of my issues.

I was having trouble swapping the controls on durein the control init or load. All of teh swapping that my demo shows now is done in response to a button click evetn. At this time the entire control tree is loaded and swapping can occur. When I attempt to do it on Init or Load the control tree is not complete and I get an error.
I think that I can work around this issue by creating a custom placeholder control that each module will be loaded onto. This control will deterine what controls to load and unload.
I plan on messing with it again after the May 31st release. I also want to make a more practical example using the AV calendar module.
5/21/2004 2:09:22 PM
Hi Bert

I did a button mainmenu that dynamically loaded controls. It uses Session and works like this:
I think in vb.net you can use the instr() method instead of IndexOf.

foreach(string r in Request.Form.Keys)
// Hier die einzelnen Buttons eintragen
if (m_uc != "ucLocations.ascx")
// aha es gab ein Wechsel also State ändern
m_nuc = "ucLocations.ascx";
if (m_uc != "ucTeams.ascx")
m_nuc = "ucTeams.ascx";
if (m_uc != "ucGames.ascx")
m_nuc = "ucGames.ascx";

5/24/2004 12:02:12 PM

Similar Artilces:

this.Controls.Add does not add control to child collection (this.Controls.Count == 0)
Ok, as silly as it may sound, I have a situation where I am creating a CompositeControl in ASP.NET 2.0, C#. I have the following code in the CreateChildControls() method that build the control's child control collection: 1    for (int i = 0; i < _menus.Count; i++)2    this.Controls.Add(_menus[i]);3    4    foreach (FloatingMenu menu in _menus)5    {6    Label lbl = new Label();7    lbl.ID = string.Concat("GroupQ", menu.ID);8    lbl.CssClass = "menuIt...

Controls.Add in Composite Control that inherits another control
Hi! I created a composite control that inherits from the WebControls.Button. I added the following in the Load event:         Dim mHidden As New WebControls.HiddenField        Me.Controls.Add(mHidden) but the control is not created. Why?Dimitris PapadimitriouSoftware Development Professional Hi,Child controls on Button do not make much sense (how would you expect them to be rendered, doesn't button allow only text into value attribute?). Button allows child controls to be added, but they won't be rendered b...

How do I control one control from another control?
I have a page page1.aspx which is within a master page. On page I have a table with two cells. Within each cell I have placed two controls (ascx) that I have developed. Now I'd like to be able to get these two controls to interact. One needs to update the other. One has some search criteria that the other one needs to update its gridview. One needs to make the other visible/not visible at certain times. Out of the box neither control can see each other at all. Is there a good article or someplace I can find some information on how to do this?  AllAboutFocus.com. Information Technolo...

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

Add .Net Control to Web Custom Control
 I want to add .NET Control (like: TextBox, Button...) to Web Custom Control.How i can do it? Alphavn That's called a composite control -- "Mark As Answer" if my reply helped you -- Hello Guys What gunteman said, that is one approach and in most cases the right one.But its also possible to add child controls to a Control thats inherit from WebControl itself. Be sure to implement INamingContainer to that inherited Control too, thats the important point of that approach.--Microsoft MVP - Visual Developer ASP / ASP.NET- http://www.aspnetzone.de/blogs/peterbuch...

Add controls in textbox ( TextBox1.Controls.Add(); )
hi to alli want to know about TextBox1.Controls.Addit is possible to add controls in a textbox like placeholder i am using  this much of code for add linkbutton in a textbox 1 LinkButton lb = new LinkButton();2 lb.Text = "Linkbutton1";3 lb.ID = "link1";4 5 TextBox1.Controls.Add(lb);6 7 Response.Write (TextBox1.Controls.Count);8 Response.Write(TextBox1.Controls.ToString());this code run without any error when i count a control in textbox then it will disply me a 1 but on the page it will not display any controls in a textbox if this is...

Add controls to a server control
Hi,I have something like this<MyControls:SomeControl Id... runat...>    <MyControls:OtherControl Id... runat.../>    <MyControls:OtherControl Id... runat.../>    <MyControls:OtherControl Id... runat.../>...</MyControls:SomeControl Id... runat...>My class SomeControl has a MyOtherControlList ( as List<OtherControlType>) and a propertypublic OtherControlType OtherControl {    set { MyOtherControlList.Add(value); }}I never get into the property set() method. What am I doing wrong? What do I need to d...

How to add controls to a Control Collection?
Hello,I have an array of controls:Dim MyControls() As Control...How can I add all the controls in MyControls array to a control collection?Thanks,Miguel At it's simplest,. couldn't it look simply something like  For Each c As Control In MyControls Controls.Add(c) Next Thanks,Teemu KeiskiFinland, EU...

Add a control to my Composite Control?
I've made a composite control, and I'm wondering how to add controls (any controls) to my control from a webform.aspx file... Much the same way you would add controls to an Panel WebControl: <asp:Panel id="somePanel" runat="server">    <asp:TextBox id="myTextBox" runat="server"></asp:Panel> this is technically the same as doing this in the codebehind:this.somePanel.Controls.Add(myTextBox); So, I know I can add controls to my Composite control like this:this.myCompositeControl.Controls.Add(someNewControl); Ho...

How to add the repeater control without Webmatrix making a User ControL?
Hi, I have a web site that is being hosted for me. I also have SQL server at the same host. Well, I connected to the database, opened an ASPX page and tried to drag a table to the page. Webmatrix tried to make a user control? I want a repeater control? How do I go about adding a repeater control? I don't want Web Matrix guessing as to what I want.. Any tutorials that I could use for this for web matrix and adding controls? Thanks Tim...

How do you control the placement of controls in a user define control
I have a user define control.  I put the control on the (C# Visual Studio 2008) page where I want them. When I run the program, the controls are all over the page.  How do I place them where they do not move form where I put them? You'll need to study the HTML output and see what it's producing, then start to look at how to do an HTML layout. hi, there are absolute and Relative position in html. I guess you must use relative position. For example, at design-time, you place a TextBox below an Image, at run-time, no matter what size is the image, the TextBox is alway bel...

Trying to load a control into a control from another control
Exactly as the subject states, I'm trying to load a control into another control from a control loaded into a page, I keep getting this error from the code I have below. I've also tried the findcontrol but it keeps coming up null. (67): 'System.Web.UI.UserControl' denotes a 'class' where a 'variable' was expected UserControl ut = ((webcontrols.BrowseItems)UserControl).LoadControl("BrowseItems"); ((webcontrols.BrowseItems)UserControl).pnl_browse_main.Controls.Add(ut); This is how we Load User controls into a content place holder. try { UserCont...

How to add the data present in the controls to a table control without any database involvement.
Hi All,i am four controls where i will write the text and once i click the add button those should get added to the table .i want 6 columns fixed in the table and rows as many as required.i tried doing that taking a table server control and able to load the table.but the problem is whenver i am adding a new row the old one is gfetting overwritten by this and at the end i am getting only one row.  System.Web.UI.WebControls.Table t1 = new System.Web.UI.WebControls.Table();  i have declared the below one global TableRow tr; TableCell tc1; TableCell tc2; TableCell tc...

How Do I add multiple controls on multiple postbacks without loosing the prior postbacks control?
I am trying to add controls programatically and am able to add one control successfully using the placeholder.controls.add(mycontrol) command. The problem I have is that when I then try and add another control on a subsequent postback, it's overwriting my first control. So I need a technique to deal with this using asp.net The page I am writing will be used to create an on-call schedule - it starts with a single dropdown of users, and a button called 'add user' When the user presses the button, a second drop down is added, and they can pick an additional user to add to the on...

Control InkPicture
Hi! Which Control is used by the InkPicture in PB. Is it the RichInk Control of Microsoft? ...

Web resources about - Dynamic Slave Controls - Dynamically add and remove controls without a dispatch control? - asp.net.dotnetnuke-framework

Placebase team at Apple file “Schematic Maps” patent dynamically detailing important data
In a report from Computerworld way back in 2009, we learned that Apple had quietly acquired Maps API company Placebase. Then, founder of Placebase ...

Apple's Lightning port dynamically assigns pins to allow for reversible use
... a closer look at how Apple's new Lightning connector works, and has come to the conclusion that the 8 pins on each side of the plug are dynamically ...

In a dynamically typed language, is it a bad idea to return different data types?
In some cases, returning different types from a single function works.

Urlbox Launches Screenshots-as-a-Service Platform to Dynamically Update Galleries
... changes. Launched yesterday, Urlbox allows anyone with a gallery displaying website screenshots to automate the process and keep them dynamically ...

Everything.me launcher dynamically adapts to what you’re doing right now
... phone according to what you’re doing. Perform a search for ‘football’ and your background will change to the NFL logo. A launcher that dynamically ...

A YouTube Experiment Resizes the Player Dynamically
There's a new YouTube experiment that changes the video player's size, depending on the browser window's size. When resizing Chrome's window, ...

Apple Granted “Dynamically Changing Cursor for User Interface” Patent, Originally Filed in 2003
... a utility patent that covers the use of the mouse cursor that changes according to the context of the task it is engaged in. Called a “Dynamically ...

Atmel's FPSLIC II Dynamically Reconfigurable SoC Supports "Silicon-Sharing" For Peripherals & Interfaces ...
Silicon-Sharing Fits 200K Gate Design into 40K Gate FPSLIC II's, Cuts Power Drain by 97%

Everything.me Launcher Wants to Dynamically Change Phones Based on Location, Interests, and Mental State ...
What if your phone’s launcher dynamically changed based upon interests, your location, or topics you had in mind at a specific moment? A new ...

Resources last updated: 12/7/2015 1:04:12 AM