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

How to write a control that doesn't require a closing tag

Hi all,

I've built a custom control that won't contain any inner content. If I
derive the control from Control, then the VS editor will always add the
closing tag when I use the control. I can derive from UserControl and
it doesn't do this, but I'm not sure whether is the best way to do
this.

What is the correct way to make a control that is self-closing (i.e.
doesn't have a closing tag)?

Thanks,

Paul

Sep 20 '06 #1
4 1284
If you dont want to use a closing tag you can use a />

ie:

<MyCompany:UserControl id="something" text="blah" />

Is that what you mean?

Sean

Paul wrote:
Hi all,

I've built a custom control that won't contain any inner content. If I
derive the control from Control, then the VS editor will always add the
closing tag when I use the control. I can derive from UserControl and
it doesn't do this, but I'm not sure whether is the best way to do
this.

What is the correct way to make a control that is self-closing (i.e.
doesn't have a closing tag)?

Thanks,

Paul
Sep 20 '06 #2
Hi Sean,

I know you can do that, but I'd like to know what the recommended way
of writing controls that the form designer knows don't need closing
tags - i.e. when you complete the opening tag it self-closes the
opening tag with "/>".

Thanks,

Paul

Sean Chambers wrote:
If you dont want to use a closing tag you can use a />

ie:

<MyCompany:UserControl id="something" text="blah" />

Is that what you mean?

Sean

Paul wrote:
Hi all,

I've built a custom control that won't contain any inner content. If I
derive the control from Control, then the VS editor will always add the
closing tag when I use the control. I can derive from UserControl and
it doesn't do this, but I'm not sure whether is the best way to do
this.

What is the correct way to make a control that is self-closing (i.e.
doesn't have a closing tag)?

Thanks,

Paul
Sep 20 '06 #3
Paul wrote:
I know you can do that, but I'd like to know what the recommended way
of writing controls that the form designer knows don't need closing
tags - i.e. when you complete the opening tag it self-closes the
opening tag with "/>".
Ah, so your request, restated, is this:

"Hey Microsoft! Please spend the several thousand man hours required
to spec, approve, implement, test, document and release a new version
of Visual Studio.NET so that I will occasionally be saved a single
keystroke."

I hate to dissapoint, but it looks like you'll just have to work on
your pinky-ring finger dexterity a bit.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Sep 20 '06 #4
I didn't think it was an outrageous question, but if you want to be a
tool, be my guest.

Paul

Jason Kester wrote:
Paul wrote:
I know you can do that, but I'd like to know what the recommended way
of writing controls that the form designer knows don't need closing
tags - i.e. when you complete the opening tag it self-closes the
opening tag with "/>".

Ah, so your request, restated, is this:

"Hey Microsoft! Please spend the several thousand man hours required
to spec, approve, implement, test, document and release a new version
of Visual Studio.NET so that I will occasionally be saved a single
keystroke."

I hate to dissapoint, but it looks like you'll just have to work on
your pinky-ring finger dexterity a bit.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/
Sep 21 '06 #5

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

Similar topics

2
by: zapazap | last post by:
Dear Snake Charming Gurus, (Was: http://mail.python.org/pipermail/python-list/2004-January/204454.html) First, a thank you to Tim Golden, Thomas Heller, and Mark Hammond for your earlier help...
0
by: NancyASAP | last post by:
In case anyone hasn't seen this problem, just sharing the info.... I created a dotnet 1.1 page with a literal control. I used a streamreader to open a text file to fill the control. I filled the...
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
6
by: darrel | last post by:
I'm not a big fan of fly-out navigation, but I have a need for it on an internal application we're developing. Before I build my own, I thought I'd see what I could find. I found a lot of ..net...
7
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
14
by: Jeroen | last post by:
Hi all, I've got a question about writing a library. Let me characterize that library by the following: * there is a class A which is available to the user * there is a class B that is used...
13
by: ray | last post by:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/ <TITLE>HTML to Text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.