Asp.net 如何在静态web方法中注册客户端脚本?

Asp.net 如何在静态web方法中注册客户端脚本?,asp.net,c#-4.0,static-methods,client-side-scripting,Asp.net,C# 4.0,Static Methods,Client Side Scripting,我想在静态web方法中注册客户端脚本。这是我的密码: public static class ScriptRegister { public static void RegisterScript(Page page, string script) { page.ClientScript.RegisterStartupScript(typeof(Page), "Refresh", script, true); } } 我使用这个类来注册客户端脚本

我想在静态web方法中注册客户端脚本。这是我的密码:

 public static class ScriptRegister
 {
    public static void RegisterScript(Page page, string script)
    {
        page.ClientScript.RegisterStartupScript(typeof(Page), "Refresh", script, true);
    }
 }
我使用这个类来注册客户端脚本

  [WebMethod]
    public static void UpdateCartCount(int prodId, int count)
    {
            ...
             ScriptRegister.RegisterScript(this.Page,script);
    }

如你所知,我不能在静态方法中使用这个。您对此有什么建议吗?

您如何调用UpdateCarCount方法?