htmlfile:对方法或属性访问的意外调用 [英] htmlfile: Unexpected call to method or property access
问题描述
我正在尝试使用AjaxControlToolkit的RoundedCornerExtender在ASP.NET网站中使用圆角"按钮.当我在Buton控件上使用此控件时,出现一条错误消息:"htmlfile:对方法或属性访问的意外调用",可以对其进行中断/继续.
当我运行这些站点时,它给我一个错误意外调用Mathod或访问属性".以下是屏幕截图: ^ ]
Hi,
I am trying to use Rounded Corner buttons in my ASP.NET website using AjaxControlToolkit''s RoundedCornerExtender. When I use this on a Buton control, I get an error saying "htmlfile: Unexpected call to method or property access" to which I can Break/continue.
When I run the sites, it gives me an error "Unexpected call to mathod or property access".Here''s the screenshot: http://img29.imageshack.us/img29/7051/roundedcornersp.png[^]
推荐答案
您可以在 ^ ](使用内联CSS的Style属性(IIRC)或用于设置类的Attributes属性).您还可以创建一个从Button继承的类并重写Render方法,然后可以像使用标准Button一样使用Click事件.
要进行更多自定义,您可以创建自己的自定义Button类,该类继承自WebControl并覆盖其渲染方法:
You could set CSS properties on the standard button class[^] (using the Style property for inline css (IIRC) or the Attributes property for setting the class). You could also create a class inheriting from Button and override the Render method, you can then consume the Click event as you would with a standard Button.
For more customisation, you could create your own custom Button class that inherits from WebControl and override its Render method:
public class RoundedButton : System.Web.UI.WebControls.WebControl
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
// render custom html here using the HtmlTextWriter
}
}
检查此 [ HtmlButton [
Check this[^] out for information about developing custom server controls.
There is also a HtmlButton[^] class which you could use in a similar fashion.
这篇关于htmlfile:对方法或属性访问的意外调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!