谢谢,上次问题已解决。新问题(一并给分):public void page_load(Object S, EventArgs E)
{
  Hashtable CfgSection = Context.GetConfig("test"); --报错点
  String Msg = CStr(CfgSection("key"));
  lblmsg.Text=Msg;
}报错:
Compiler Error Message: CS0029: Cannot implicitly convert type 'object' to 'System.Collections.Hashtable'如果改为:
public void page_load(Object S, EventArgs E)
{
  Hashtable CfgSection = (Hashtable)Context.GetConfig("test");
  String Msg = CStr(CfgSection("key")); --报错点
  lblmsg.Text=Msg;
}报错:
Compiler Error Message: CS0118: 'CfgSection' denotes a 'variable' where a 'method' was expected

解决方案 »

  1.   

    这个问题同你的第一个问题一样啊,应该是CfgSection["key"]
      

  2.   

    还是不行,我试过了
    报错:Compiler Error Message: CS0103: The name 'CStr' does not exist in the class or namespace 'ASP.formcfg_aspx'
      

  3.   

    用CfgSection["key"].ToString(); 试一试
      

  4.   

    部分解决,可是还是有一点问题。
    明明应该有值的,为什么是空值呢?CfgSection["key"].ToString(); 
    报错:
    Exception Details: System.NullReferenceException: Value null was found where an instance of an object was required.