473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Generate web controls programitically

This is basically repost of my previous (unanswered) question.
What I try to do is to generate Web controls on the Page surface during
design time from withing my own component; they do appear in the code behind
but not on the surface of Designer. Moreover, they DO exist in
container.Components collection.

May be someone knows (at least) how to make a control to generate it's own
html design time code (this <of type <asp:...>, not HTML rendering...)?

<repost starts here>

I try to add a textbox from code of my custom component laid on the web form.
It appears in the code behind but not in the designer; moreover when I switch
from design to html view it gets removed from the code-behind.
What interesting: when (by mistake) I tried to add Windows TextBox the code
added it to the component section of the designer (so "almost" desired
behaviour...)
Any ideas, please?

The code is based on MSDN example of component
ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/cpref/html/frlrfSystemComponentModelDesignIDesignerHostClassT opic.htm
- I'm trying this code when user double-clicks component

IDesignerHost host =
(IDesignerHost)this.component.Site.GetService(type of(IDesignerHost));
IComponent newItem =
host.CreateComponent(typeof(System.Web.UI.WebContr ols.TextBox), "txtNew");
//when this code used, works
//IComponent newItem =
host.CreateComponent(typeof(System.Windows.Forms.T extBox), "txtNew");

Nov 18 '05 #1
0 935

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen Tang | last post by:
Hi, I'm relatively new at this language, so I've been trying to find parallels to problems I've run into in the past. This is the hypothetical problem: I want to write a CD inventory...
4
by: Chris Bower | last post by:
Reposted from aspnet.buildingcontrols: Ok, I've got a bunch of derived controls that all have a property Rights of type Rights (Rights is an Enumerator). I wrote a custom TypeConverter so that I...
3
by: Dennis M | last post by:
Hey everyone, I am curious what the performance impact of a custom control would be if it had a significant hierarchy of children. For example, 40 child controls, 5 levels deep, each control on...
5
by: sambuela | last post by:
All data controls and wizards about dataset, adapter or dataviewer disappear in the IDE. How can i let them appear again? It is because i want to generate dataset by these wizard. Thanks in...
4
by: WB | last post by:
Hi, How can I generate web controls such as textboxes and drop-menus on the fly? My web application allows users to fill out PDF forms online. There are many PDF forms, and my application...
0
by: Avon | last post by:
Hi friends, I am very sorry for my not perfect English. I have one question, I am using David Bauer's DynamicControlsPlaceholder to dinamically generate controls and I am tryig to generate...
1
by: Scott Zabolotzky | last post by:
I'm sure somebody has to have done this already but I can't find any good references. If I have an XML file with an associated XSD what is the best way to dynamically generate a web form with...
5
by: sean.gilbertson | last post by:
Hi, I'm sort of new to ASP.NET 2.0 and ASP.NET in general. I have some data that I would like to display in a tabular format, but I'm going to be generating the columns dynamically, and I would...
2
by: | last post by:
Hi, I have 2 scenarios: First, an aspx page that contains 300 controls with the labels of course in a table. Second, an empty aspx page that contains on loading a script that creates the 300...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.