this.ProButton.Click += new System.EventHandler(mysuoyu.Save_Profile.Button); 这句话就是调用了MYSUOYU.SAVE_PROFILE的静态方法BUTTON除非你这么写不用STATIC mysuoyu.Save_Profile cc = new mysuoyu.Save_Profile(); this.ProButton.Click += new System.EventHandler(cc.Button);但不管怎么说你的方法都是不好的,不要把事件函数作为工具函数,你应该把BUTTON()函数里的内容重新包装成函数防到你的mysuoyu.Save_Profile类里
mysuoyu.Save_Profile cc = new mysuoyu.Save_Profile(); this.ProButton.Click += new System.EventHandler(cc.Button); 是能编译通过了,但是发现在new mysuoyu.Save_Profile.Button()里面,还是要这样用 HttpContext.Current.Response.Write ("ddd"); 而不能Response.Write ("ddd");纳闷。
这句话就是调用了MYSUOYU.SAVE_PROFILE的静态方法BUTTON除非你这么写不用STATIC
mysuoyu.Save_Profile cc = new mysuoyu.Save_Profile();
this.ProButton.Click += new System.EventHandler(cc.Button);但不管怎么说你的方法都是不好的,不要把事件函数作为工具函数,你应该把BUTTON()函数里的内容重新包装成函数防到你的mysuoyu.Save_Profile类里
则要Button是静态成员,因为这样是通过类名来访问函数,要静态函数
所以要用this.Button
this.ProButton.Click += new System.EventHandler(cc.Button);
是能编译通过了,但是发现在new mysuoyu.Save_Profile.Button()里面,还是要这样用
HttpContext.Current.Response.Write ("ddd");
而不能Response.Write ("ddd");纳闷。