Hi Brain,
Thanks for posting in the community!
As for your question that "whether possible to add client side attributes
in the ASP.NET server control's html source(aspx page)", I agree with bruce
that we can only specify the Server control's specified attributes in its
tag such as
<asp:Button...> <asp:Label ...> ..
In fact, when the asp.net runtime parsing the aspx page, it'll parse the
asp.net server controls( not html server controls) according to its class
in framework, and these classes has their buildin attributes which are
quite different from html element's attributes( only for serverside code's
controling). The runtime construct a server control's instance via the
attribuets and finally render it out to client via some certain mapping
(from these attributes to the proper html element attributes). So we can't
add clientside used attributes in ASP.NET server control's source template
in aspx page(html view). One way to do this is via their' "Attributes"
collection in code behind as you've mentioned. If you do want to add
clientside attributes in aspx file(html view), I think you can try using
the HtmlServerControls instead, because they're directly mapping to html
element. Do you think so?
In addition, here are some tech ariticles on the ASP.NET servercontrols and
html server controls:
#ASP.NET Server Controls Recommendations
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbconchoosingwebformscontrols.asp
#ASP.NET Server Controls and Browser Capabilities
http://msdn.microsoft.com/library/en-us/vbcon/html/vbconWebFormsControlsBrow
serCapabilities.asp?frame=true
#HTML Server Controls
http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconASPSyntaxForHTMLC
ontrols.asp?frame=true
#The Forgotten Controls: HTML Server Controls
http://msdn.microsoft.com/library/en-us/dnaspp/html/ASPNet-ForgottenControls
.asp?frame=true
Hope these also helpful.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx