Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2009, 09:59 AM
Authorized User
 
Join Date: Jul 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to dilionyi
Default Creating Forms & Controls Dynamically

Can someone pls help me with this? Its urgent. How can I allow an administrator to add create forms on the fly with option for adding different controls on created pages.
 
Old March 11th, 2009, 03:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I hope it's not too urgent as this is not an easy thing to do...;-)

Creating controls on the fly is no problem. Add a Panel to a page and then you can do stuff like:

Label myLabel = new Label();
myLabel.Text = "Some Text";
myPanel.Controls.Add(myLabel);

However, judging from your post, this is probably not enough. What exactly are you trying to accomplish? What do you want to let the administrator do? Do you want to do these kind of things in a WYSIWYG fashion?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 12th, 2009, 11:49 AM
Authorized User
 
Join Date: Jul 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to dilionyi
Default

Hi Imar,
Thanks for your reply. However, the kind of thing I want to accomplish is this. I have like a container of controls on a page that the administrator only has access to. Then if an owner requests for a particular set of controls to be on his webpage, the admin can create that webpage with this set of controls which in turn can be used by a larger community. Its like 4 levels
Programmer - Administrator - Owner - Larger community of users.

Programmer creates a webpage with a vast set of controls and the entire framework.
Administrator can customize these controls on various webpages depending on what the owner requires.
Owner determines what set of controls he wants on his page.
Users can now access the webpages of the owner and entire their information depending on the what is contained on the particular owners page they're in.
I know this can be done but I have just a vague idea of how to go about it.
I hope this is quite detailed. Thanks
 
Old March 13th, 2009, 04:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Programmer creates a webpage with a vast set of controls and the entire framework.
Using Visual Studio or a web based application?
Quote:
Administrator can customize these controls on various webpages depending on what the owner requires
Again, how? Visual Studio is probably the best tool for this but it doesn't sound like this is what you're after.

In short, there are a few ways to create web pages:

1. Hand craft them using something like Notepad.

2. Create them using Visual Studio

3. Create them using run-time code. You could, for example, based on a database scheme create code on the fly, store them in assemblies with embedded pages as resources and run them on the fly using stuff like Virtual Path providers. However, this is quite complex stuff and requires knowledge about VPP, CodeDom, how the whole .NET run-time, ASP.NET pipelines work, maybe even down to MSIL. This will get even more complex if you want to offer your users a UI to do this.

So, again, what is it exactly you want to do Where do you want to let users do this? Inside Visual Studio or all web based? Please provide much more detail on how you see this happen, how you'll let users create pages, how you'll execute the pages at run-time and so on and so forth.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to call forms dynamically reyboy Pro VB 6 11 July 7th, 2006 09:53 PM
dynamically creating controls rahulpokharna C# 1 January 11th, 2006 12:47 PM
Dynamically resizing forms siptah Access 4 May 11th, 2005 04:24 AM
Creating Charts & Graphs on Web Forms Harley VB.NET 1 April 5th, 2005 08:34 AM
Creating controls dynamically Renu ASP.NET 1.0 and 1.1 Basics 9 December 19th, 2004 10:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.