Apqu
Apqu

Reputation: 5031

Modify ASP.NET TextBox generated html?

Is it possible to modify the html generated by ASP.NET so that it automatically closes the input tag for a <asp:TextBox> currently it is generating the follow html code:

<input name="ctl00$txtTest" type="text" value="xxx" id="txtTest_0">

is it possible for it to generate the same but with a self closure tag as follows (note the forward slash at the end):

<input name="ctl00$txtTest" type="text" value="xxx" id="txtTest_0" />

Is the something i could do to perhaps force a specific DocType rendering or similar?

Upvotes: 0

Views: 375

Answers (2)

Med.Amine.Touil
Med.Amine.Touil

Reputation: 1235

if you use Visual studio go by these steps Tools ---> Options ---> Text Editor ---> HTML ----> Formatting ---> remove Auto insert close tag

Upvotes: 0

Owain van Brakel
Owain van Brakel

Reputation: 3349

This should work

Tools > Options > Text Editor > HTML > Advanced > XHTML coding style change to False And then:

Tools > Options > Text Editor > HTML (Web Forms) > Formatting > Tag Specific Options > Default Settings > Client tag does not support contents > Closing tag change to No closing tag

after that debug again and check the generated source

Upvotes: 1

Related Questions