Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem with FormView on dynamically created UserControl!!Problem with FormView on dynamically created UserControl!!
Previous
 
Next
New Post
4/30/2007 7:14 AM
 

I am creating an application that has quite a few different screens, I have broken the screens up into UserControls.  The main UserControl has a Tab system that allows the user to navigate between the different UserControls (screens)... I have currently made the screens available in the main UserControl by dragging the UserControl file (from the SolutionExplorer), then setting the Visible property of the different UserControls depending what Tab is selected.  This method of creating an application is probably not the best way to do things... especially if the application was to expand.

 

So I tried changing it so the main UserControl dynamically creates the UserControl screen on the fly... by using something like the following... (C#)

MyUserControl myScreen = (MyUserControl)LoadControl("MyScreen.ascx");
MyMainPanel.Controls.Add(myScreen);

But when the screen loads, some controls in myScreen do not instantiate (like controls within a FormView on the UserControl)!!

Why would this be happening?  I thought once a UserControl is created and added dynamically, all the controls within it would work just as if I dragged the UserControl into the Main UserControl..  (The <@Register ... > tag is still in place on the Main UserControl)

Please Help!!  :o(

 

 

 
New Post
4/30/2007 10:56 AM
 

For example code see:

DynamicForms

However, also see this for recommended Module Navigation Options

 



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
4/30/2007 7:00 PM
 
Great article on the DynamicForms, Michael! [:)]

I was having all sorts of issues with the asp.net process crashing all over the place when trying to load the control dynamically - and, after a night of scratching my head I realised I had module caching turned on. Always the simple things ... thought I'd mention it just in case anybody falls into the same trap.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem with FormView on dynamically created UserControl!!Problem with FormView on dynamically created UserControl!!


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out