views:

28

answers:

1

I have built a simple custom ASP.NET control that expects it's body content to be javascript. Is there a way to tell Visual Studio that the content should be javascript, and therefore provide syntax highlighting / intellisense goodness?

In case it helps, here's the framework of the control I'm working with.

namespace MyNamespace
{
    public class MyControl : Control
    {
        public override void RenderControl(HtmlTextWriter writer)
        {
            // Do Stuff
        }
    }
}

And it's usage in a page:

<prefix:MyControl runat="server">
    function someFunction(){...}
</prefix:MyControl>

I'm hoping that there's simply an attribute I can add to the class.

A: 

Hey,

That's going to be hard to support, it would be easier to allow the tag, and have your control essentially wrap the script... Out of the box, you may be able to inherit from WebControl, and change the TagName property to return a script tag, but out of the box I don't think what you are asking to do is possible with intellisense support. Without intellisense, sure it will all work fine at runtime.

Brian