ASPX Web control syntax question

danomatic

Member
Joined
Oct 26, 2002
Messages
7
Location
Boston, MA
Is it possble to set VS.Net to make this tag:

Code:
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>

appear by default like this?

Code:
<asp:TextBox id="TextBox1" runat="server" />

or is there a danger in this? I am new to ASP.Net

Dan
 
Actually, by default it should have a closing tag. (As in your first example.)

[edit]Sorry, I miss-read your question, It is ok to use the second method, but I dont know how to set it as default within the designer.
 
Im not sure how to set it as default, but theres no real difference in the two. Its just that the 1st option there allows you to put text between the opening and closing tag to display within the TextBox, while the other would require using the Text property.

As with almost everything else in ASP.NET, theres a bunch of different options to do various things, and the reason is mostly to let those coming from HTML/ASP migrate easier into the .NET world.
 
Back
Top