473,326 Members | 2,196 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,326 software developers and data experts.

label versus asp:label Question. Thanks.

Hello,

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
accessible.

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.

Thanks,
Miguel

Nov 19 '05 #1
2 3596
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:
http://steveorr.net/faq/3in1.aspx#HTMLvsWeb

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

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
accessible.

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.

Thanks,
Miguel

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 programmatically, 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 programmatically, 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

7
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...
2
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. ...
7
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...
3
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>
10
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...
1
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...
5
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...
2
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...
12
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.