0

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?

1

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your response but it seems to render exactly the same when run?
0

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

1 Comment

Thanks for your response but it seems to render exactly the same when run?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.