关于.net 控件的html 属性的几点技巧
前台html 页面中进行控件html 属性的设置一般为静态的属性,当然也可以通过嵌入脚本语言代码进行一些简单的动态设置,但并不能实现复杂的逻辑也会给维护带来麻烦,我们可以使用 控件的 Attributes 属性下面的方法进行这些操作如下:
为控件增加 onclick 事件响应脚本: 控件名.Attributes.Add("onclick","响应脚本")
位控件增加 src url指向响应: 控件名.Attributes.Add("src","url字符串")
为控件增加 onclick 事件响应脚本: 控件名.Attributes.Add("onclick","响应脚本")
位控件增加 src url指向响应: 控件名.Attributes.Add("src","url字符串")