473,890 Members | 5,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

label versus asp:label Question. Thanks.


I am creating a contact form in ASP.NET and I need to access the labels
on Page_Load on my aspx.vb file.

The other elements such as input box and text box don't need to be

What are the advantages of using HTML tags such as <label> over the
ASP.NET tags such as <asp:label>?

I am asking cause if it is the same I would always use the asp tags so
if in the future I would need to access them from Page_Load I wouldn't
need to change the tags again.


Nov 19 '05 #1
2 3618
HTML controls are slightly more efficient.
If performance is your top priority then you should pretty much always use
HTML controls when you don't need the advanced capabilities of the
equivalent web control.
Here's more info:

I hope this helps,
Steve C. Orr, MCSD, MVP
"Shapper" <mdmoura*NOSPAM *@gmail.*DELETE 2SEND*com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..

I am creating a contact form in ASP.NET and I need to access the labels on
Page_Load on my aspx.vb file.

The other elements such as input box and text box don't need to be

What are the advantages of using HTML tags such as <label> over the
ASP.NET tags such as <asp:label>?

I am asking cause if it is the same I would always use the asp tags so if
in the future I would need to access them from Page_Load I wouldn't need
to change the tags again.


Nov 19 '05 #2
There are actually a few differences. The asp:Label renders as a
<span> tag. Regarding the <label> HTML tag, I assume you mean you will
be using HTML markup and NOT the server-side HTML controls? If so, as
Steve mentioned, these are a bit more performant, but they cannot be
accessed programmaticall y, as you noted.

Personally I use HTML markup for any content that doesn't need to be
accessed by server-side script, but I know people who like to use
asp:Labels because the VS.NET designer allows you to drag and drop them
and move them around with greater ease than vanilla HTML markup.

Really it's a style of preference. Assuming you don't need to access
the content programmaticall y, do whichever approach you prefer,
although I'd opt to use the HTML markup myself...

Nov 19 '05 #3

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

Similar topics

by: nicole | last post by:
We have completed a clean install of Microsoft Server 2003 on our Web Server and are using frontpage 2002 for our web site. On our asp page (www.dgf.k12.mn.us/contactus.asp) we are getting the following error: Database Results Error Description: Syntax error in query. Incomplete query clause. Number: -2147217900 (0x80040E14) Source: Microsoft JET Database Engine
by: Brian | last post by:
Hi All, Can someone please point me in the right direction I am having problems combining JS and ASP. What I am trying to do is store in a database using ASP the referring page of my visitors. I got the ASP working great and when I use the document.referrer in an alert it works too, but when I try to combine the 2 languages that is when I get an error that I cannot fix. Here is the code fragment that is not working: rs("ReferPage")...
by: Mark | last post by:
Hi... I've been doing a lot of work both creating and consuming web services, and I notice there seems to be a discontinuity between a number of the different cogs in the wheel centering around windows-1252 and that it is not equivalent to iso-8859-1. Looking in the registry under HKEY_CLASSES_ROOT\MIME\Database\Charset and \Codepage, it seems that all variations on iso-8859-1 (latin1, etc) are mapped to code page 1252, which I'm...
by: Stan Sainte-Rose | last post by:
Hi Guys, A simple question I have a xml file <lg> <part name="myPart"> <subpart name="ab">ab</subpart> <subpart name="cd">cd</subpart> <subpart name="ef">ef</subpart> </part> </lg>
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
by: Denis | last post by:
Hi I need info about #include directive in classic ASP I've 2 library of functions library1.asp and library2.asp library1.asp uses functions contained in library2.asp These library have to be used all around my site so, can I include
by: Mark | last post by:
Hi all, I have a .NET webservice which I would like to consume from a classic ASP page. Furthermore, I would like to populate a recordset (if possible) with the data from the returned webservice so I can implement paging in the classic ASP page... Does anyone have any idea if I can do this, and if so, how I would go about implementing it? TIA
by: Tom Edelbrok | last post by:
I'm reading the section "Postbacks and Round Trips" in the Visual Studio 2005 Help (I use VB.NET). Amongst other things, it says that as a result of a postback "On the Web server, the page runs again. The information that the user typed or selected is available to the page." I can set this up in a test project and see that it occurs ... ie: my text boxes retain their data (ie: "Hello world") even when a postback occurs on the same or...
by: mcp6453 | last post by:
My small company has a web site that is developed in "Classic ASP", which is, I'm told, different from just "ASP". It is clear to me that we are not using ASP.NET. The site is hosted on a shared Windows Server and access a Microsoft SQL Server 2000, I think. We are having a terrible time finding someone to do some code updates. Part of the problem is that I am not familiar enough with ASP to know whether I am asking the right questions....
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.