473,386 Members | 1,705 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,386 software developers and data experts.

Control. Is this possible?

Hello,

I have been creating a few controls and I have a problem.

I want to create a control that renders a TextBox, a Label, and a few
more controls.

Is it possible to create such a control without all these controls to
be wrapped in a Tag?

Thanks,

Miguel
Dec 19 '07 #1
3 1099
Hello Miguel
I have been creating a few controls and I have a problem.

I want to create a control that renders a TextBox, a Label, and a few
more controls.

Is it possible to create such a control without all these controls to
be wrapped in a Tag?
Yes its possible.
You can use a UserControl for this requirements, or also a CustomControl
thats inherited from CompositeControl
or also from any other control.

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Dec 19 '07 #2
On Dec 19, 1:14 pm, "Peter Bucher [MVP]" <peter.buc...@aspnetzone.de>
wrote:
Hello Miguel
I have been creating a few controls and I have a problem.
I want to create a control that renders a TextBox, a Label, and a few
more controls.
Is it possible to create such a control without all these controls to
be wrapped in a Tag?

Yes its possible.
You can use a UserControl for this requirements, or also a CustomControl
thats inherited from CompositeControl
or also from any other control.

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerlandhttp://www.aspnetzone.de/- ASP.NET Zone, die ASP.NET Communityhttp://www.aspnetzone.de/blogs/peterbucher/- Auf den Spuren von .NET
Not really.

Every time I create a custom control that inherits from WebControl or
CompositeControl it renders as a Span tag with all child controls
inside it.
Of course I can change the render begin and end tag by using:

Public Overloads Overrides Sub RenderBeginTag(ByVal writer As
HtmlTextWriter)
writer.RenderBeginTag(HtmlTextWriterTag.Div)
End Sub

But what I would like is the control to render its child controls but
not having them wrapped.
Is this possible?

Thanks,
Miguel
Dec 19 '07 #3
Hallo Miguel
But what I would like is the control to render its child controls but
not having them wrapped.
Is this possible?
Yes, simply overwrite the whole Render methode of your control.
Or else for an other case, overwrite the property TagKey to set a specific
tag around
instead of RenderBegin- and RenderEndTag overrides.

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Dec 21 '07 #4

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

Similar topics

0
by: Jeff Schaefer | last post by:
What I want to know is this: Is it possible to programmatically manipulate a custom property of a user control for which <%@ OutputCache ... > has been included? If so, then how? My brief code is...
2
by: Steve Franks | last post by:
In ASP.NET 2.0 you can now apparently do this: <asp:label runat="server" text="some browser" IE:text="any IE browser" IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" /> Now the...
7
by: BradC | last post by:
(VB.NET 2002, Windows app). I'm going to be provided a two-letter string like "BV" or "TP" that represents a location. I then need to perform some actions on several form controls that have...
4
by: Captain Chaos | last post by:
Hello Is it Possible to build an ActiveX Control with NET ? I want to take a NET UserControl and use it with VB6. I found a solution how to embbed a NET UserControl into a WebPage (Like it...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
4
by: Sevu | last post by:
I am working with ASP.NET.I am using ReportViwer Control to show my report.I like to add dropdownlist with in the reportviewer control. ( Not top to the control some thing like that).I need to...
2
by: planetthoughtful | last post by:
Hi All, I have a Web User Control that I would like to use in several pages in my ASP.NET application. I'm wondering, however, if it's possible to call a function contained in the page from...
3
by: Hamed | last post by:
Hello Is it possible to get a control (e.g. a checkbox) and make a Graphics object or a Bitmap object of current face of the control? I want to implement Sparse property for a ColumnStyle so I...
11
by: Webbert | last post by:
I am trying to display XML in a WebBrowser Control. I receive a data feed of XML and am trying to inject it into the control. I have not been successful in doing so. The only solution I have...
1
by: shapper | last post by:
Hello, I am creating a user control where an Asp.Net control is used. It can be either a button, an image button or a label. I am trying to "expose" the Asp.Net control properties and events...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.