View Single Post
  #2 (permalink)  
Old April 17th, 2008, 11:07 AM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The only difference between the two examples that you have presented is that the latter is a self closing tag (hence the /> at the end instead of </asp:CommandField>). Either example will work fine without a problem.

On thing to keep in mind is that you can use this short hand to close all of your Server Control tags (Label, button, textbox, etc) however, you can't use this short hand on a dropdownlist, for example, when you explictly define the items displayed in the list:

<asp:DropDownList ID="drp" runat="server">
<asp:ListItem>foo</asp:ListItem>
</asp:DropDownList>

hth.

-Doug



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote