|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting name=, ID= for TextBoxHi;
To get google autofill to work we need controls like: <input id="address:Name" type="text" name="address:Name" size="20" /> However, for a TextBox there is no name property and IDs won't take a : as they are also C# variable names. How can I set this the a TextBox? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm Hello Dave,
As for the client-side "id" and "name" attributes of ASP.NET webcontrols, they're generated according to ASP.NET's container based naming schema. Also, for server-side identity(control's ID), such characer like ":" is not allowed. If you do want to customize the "id" and "name" attribute value (rendered in client-side html), one way is to overridde the "ClientID" and "UniqueID" propety. e.g. ===================== public class PostBackControl : WebControl, INamingContainer, IPostBackEventHandler { ................................. public override string ClientID { get { return "prefix:"+ this.ID; } } public override string UniqueID { get { return "prefix:" + this.ID; } } ................. } ================= see the following article also: http://west-wind.com/WebLog/posts/4605.aspx Sincerely, Steven Cheng Microsoft MSDN Online Support Lead This posting is provided "AS IS" with no warranties, and confers no rights.
What's the new thing after ActiveX?
AJAX n00b - custom server control in an UpdatePanel causes full postback Collection Property in web custom control Menu - Eliminate The Triangular Arror pointer thing - How to do it? Web page size html text encoding problem Programmatically modifying the controls in FormView's PagerTemplate CSS substitution for the <center> tag Gridview only displays 3 columns of 11 column dataset Gridview controls added programmatically does not appear later |
|||||||||||||||||||||||