Question: I have big trouble deploying my webservice. It is the basic helloWorld start webservice.

At my localhost everything os ok. But when I copy the service to my server in my virtual directory i recieve this error:

> 
> Server Error in '/' Application.
> 
> 
> Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
> 
> 
> Parser Error Message: Could not create type 'Service'.
> 
> 
> Source Error: Line 1: <%@ WebService Language="vb" CodeBehind="~/App\_Code/Service.vb" Class="Service" %>
> 
> 
> Source File: /customers/iv\_webservice/Service.asmx Line: 1
> Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955
> 
> 
> 

Now I have tried almost everything. Including scanning the web for the past 9 hours for an answer.

I know my virtual directory in the web.config is ok, since I have other virtual websites on my server. I even manage to have aspx. files in the same directory and they are ok.

Now, what am I missing?

Answer: 
I'd solved this issue by creating simple custom serverside control (for ASP.NET 4 WebForms app.):

```
[ToolboxData("<{0}:JqueryTemplate runat=server></{0}:JqueryTemplate>")]
[PersistChildren(true)]
[ParseChildren(false)]
public class JqueryTemplate : Control {
    private bool _useDefaultClientIdMode = true;

    [DefaultValue(ClientIDMode.Static)]
    [Category("Behavior")]
    [Themeable(false)]
    public override ClientIDMode ClientIDMode {
        get {
            return (_useDefaultClientIdMode) ? ClientIDMode.Static : base.ClientIDMode;
        }
        set { 
            base.ClientIDMode = value;
            _useDefaultClientIdMode = false;
        }
    }

    protected override void Render(HtmlTextWriter writer) {
        writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/x-jquery-tmpl");
        writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
        writer.RenderBeginTag(HtmlTextWriterTag.Script);
        base.Render(writer);
        writer.RenderEndTag();          
    }

}

```

and put each jquery template inside it (instead of `<script>` tag):

```
<some:JqueryTemplate runat="server" ID="myTemplateId"> 
... your template code goes here ...
</some:JqueryTemplate>

```

will rendered it in HTML as:

```
<script type="text/x-jquery-tmpl" id="myTemplateId">
... your template code goes here ...
</script>

```
Another WebForms solution, not as thorough or elegant as Rusted's solution, but I drop these two functions inside of a BasePage class from which all my other pages inherit:

```
Public Function Template(ByVal id As String) As String
    ' the type attribute does not matter as long as it's not "text/javascript"
    Return "<script id='" + id + "' type='text/template'>"
End Function

Public Function Template() As String
    Return "</script>"
End Function

```

Then in my aspx:

```
 <%= Template("templateID")%>
     ... your template code goes here ...
 <%= Template()%>

```