我可以使用asp.net和ajax在没有静态方法的情况下保存数据吗?

时间:2016-11-01 17:59:07

标签: asp.net json ajax

当我想使用Ajax在我的ASP.Net上使用静态方法保存数据时,我无法点击服务器端。但是当我把它制作成静态时,效果很好。但我需要保存数据而不需要静态。 我的代码如下。我希望使用ajax保存没有静态的数据。

public static int SaveCountry(string countryName, string countryAbout)
{
    try
    {
        country = new Country(countryName, countryAbout);
        int result = countryEntryManager.SetCountryInformation(country);
        return result;
    }
    catch (Exception exception)
    {
        return 0;
    }
    GetCountryInformation();
}

1 个答案:

答案 0 :(得分:0)

如果没有静态Mathod服务器,则无法进行ajax调用

相关问题