Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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[^]
Posted
Comments
Sergey Alexandrovich Kryukov 6-Jan-11 12:40pm    
Oh, different topic... You already finished your list class. Did you accept the last answer? :-) Just asking...
optimus_prime1 6-Jan-11 12:50pm    
:P Thanks SAKryukor for help earlier. I also read a reply by Emilio at one of your comments. He was so true about me having taken some wrong step some time back and then now for(;;)Retry();
Perhaps, one day, I'll start answering questions here instead of asking! :P
Sandeep Mewara 6-Jan-11 14:47pm    
Sounds like some old build/controls. Can you add on what versions of toolkit & browser you are using?
optimus_prime1 6-Jan-11 14:59pm    
Actually, I figured out that the RoundedCorners Extender in the AJAX Toolkit didn't apply to Button Control. So, now I have used Custom CSS buttons. But there's one problem: Earlier, I had the button control performing the code-behind operation. Now, I have a HTML button. How can I accomplish the same code-behind process now?

1 solution

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:

C#
public class RoundedButton : System.Web.UI.WebControls.WebControl
{
    protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        // render custom html here using the HtmlTextWriter
    }
}


Check this[^] out for information about developing custom server controls.

There is also a HtmlButton[^] class which you could use in a similar fashion.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900