Home


.Net, SQL and softball. Musings of a software developer with a softball problem

Friday, June 13, 2008

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

posted by Tom Becker at

0 Comments:

Post a Comment

<< Home

Powered by Blogger

Subscribe to
Posts [Atom]

Name: Tom Becker
Location: Richmond, VA, United States