.Net Mailbag
So I got an email from a co-worker who normally does ColdFusion work and is working his way into .Net, and he posed the following question that I thought would be a good post here.Question:
If I'm not going to do anything dynamic with my label, is there a reason to use<asp:label> instead of just plain <label> in my ASPX code?My Reponse:
Pretty sure you're gonna have to use the ASP label. When your page compiles it will change the name of the control you are referencing.For example, if you have a text box that is just sitting out by itself called txtSomething. Once the page complies the textbox name will change to something along the lines of cp100_txtSomething.
Since this happens the traditional HTML label control will lose it's association. With the ASP label it will update the reference.
If you are not doing anything dynamic with that label however and want to save a little bit of memory, you can change the EnableViewstate property on the control to false and it won't bother storing it in the viewstate.
Labels: .NET
posted by Tom Becker at
6/13/2008
![]()

0 Comments:
Post a Comment
<< Home