-2

Possible Duplicate:
ASP.NET: how to remove 'name' attribute from server controls?

On asp.net form controls setting the id attribute seems to generate 2 attributes (id, name) with the same value in the rendered html. Is there any way to disable generation of the name attribute?

For example a textbox with id textBox1 generates html like:

<input type="text" id="textBox1" readonly="readonly" name="textBox1"></input>
Community
  • 1
  • 1
Vinay B R
  • 8,089
  • 2
  • 30
  • 45

1 Answers1

0

the id/name property is standard for html. many js libraries take advantage of both attributes. why would you want to remove the name attribute?

Jason Meckley
  • 7,589
  • 1
  • 24
  • 45
  • i do not use any js libraries and ids in my case are quite long so size of the response is affected. some one just posted a link to another question but creating separate controls to override render seems a bit too much for the simple thing i need – Vinay B R Jan 13 '12 at 13:21
  • yes, it is. of all the ways to improve performance/throughput removing the name attribute is *not* it. Assuming this is webforms project your bloat comes from viewstate more than anything else. after that, improving the query plans and number of remote calls is the next best way to improve performance & throughput. – Jason Meckley Jan 13 '12 at 13:30