Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override

How do I solve InvalidCaseUserControl.Dispose(bool) no suitable method found to override

Scheduled Pinned Locked Moved ASP.NET
questionasp-netdesigndebugginghelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11369001
    wrote on last edited by
    #1

    I am creating a usercontrol named InvalidCaseUserControl in web forms for a web app. When I run the code in debug mode I am getting the following errors CS0079 The event 'Control.Disposed' can only appear on the left hand side of += or -= Error CS7036 There is no argument given that corresponds to the required formal parameter 'e' of 'EventHandler' Error CS0115 'InvalidCaseUserControl.Dispose(bool)': no suitable method found to override How do I solve this?

    public partial class InvalidCaseUserControl : System.Web.UI.UserControl
    {
    private int _batchNumber;
    private System.ComponentModel.IContainer components = null;
    /// /// Clean up any resources being used.
    ///
    /// true if managed resources should be disposed; otherwise, false.
    protected override void Dispose(bool disposing)//Getting 'InvalidCaseUserControl.Dispose(bool)':no suitable method found to override
    {
    if (disposing && (components != null))
    {
    components.Dispose();
    }
    base.Disposed(disposing);
    }
    }

    Richard DeemingR M 2 Replies Last reply
    0
    • U User 11369001

      I am creating a usercontrol named InvalidCaseUserControl in web forms for a web app. When I run the code in debug mode I am getting the following errors CS0079 The event 'Control.Disposed' can only appear on the left hand side of += or -= Error CS7036 There is no argument given that corresponds to the required formal parameter 'e' of 'EventHandler' Error CS0115 'InvalidCaseUserControl.Dispose(bool)': no suitable method found to override How do I solve this?

      public partial class InvalidCaseUserControl : System.Web.UI.UserControl
      {
      private int _batchNumber;
      private System.ComponentModel.IContainer components = null;
      /// /// Clean up any resources being used.
      ///
      /// true if managed resources should be disposed; otherwise, false.
      protected override void Dispose(bool disposing)//Getting 'InvalidCaseUserControl.Dispose(bool)':no suitable method found to override
      {
      if (disposing && (components != null))
      {
      components.Dispose();
      }
      base.Disposed(disposing);
      }
      }

      Richard DeemingR Online
      Richard DeemingR Online
      Richard Deeming
      wrote on last edited by
      #2

      The base class doesn't have a method called Dispose which takes any parameters. Perhaps you meant to override the Control.Dispose method[^] instead?

      public override void Dispose()
      {
      try
      {
      if (components != null)
      {
      components.Dispose();
      }
      }
      finally
      {
      base.Dispose();
      }
      }


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      U 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        The base class doesn't have a method called Dispose which takes any parameters. Perhaps you meant to override the Control.Dispose method[^] instead?

        public override void Dispose()
        {
        try
        {
        if (components != null)
        {
        components.Dispose();
        }
        }
        finally
        {
        base.Dispose();
        }
        }


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        U Offline
        U Offline
        User 11369001
        wrote on last edited by
        #3

        Thank you for your help. For now this seems to work. I will do more testing as I continue to add to the code.

        1 Reply Last reply
        0
        • U User 11369001

          I am creating a usercontrol named InvalidCaseUserControl in web forms for a web app. When I run the code in debug mode I am getting the following errors CS0079 The event 'Control.Disposed' can only appear on the left hand side of += or -= Error CS7036 There is no argument given that corresponds to the required formal parameter 'e' of 'EventHandler' Error CS0115 'InvalidCaseUserControl.Dispose(bool)': no suitable method found to override How do I solve this?

          public partial class InvalidCaseUserControl : System.Web.UI.UserControl
          {
          private int _batchNumber;
          private System.ComponentModel.IContainer components = null;
          /// /// Clean up any resources being used.
          ///
          /// true if managed resources should be disposed; otherwise, false.
          protected override void Dispose(bool disposing)//Getting 'InvalidCaseUserControl.Dispose(bool)':no suitable method found to override
          {
          if (disposing && (components != null))
          {
          components.Dispose();
          }
          base.Disposed(disposing);
          }
          }

          M Offline
          M Offline
          Member_14850665
          wrote on last edited by
          #4

          Thank you all for your kindness to me, I wish you good health and good luck!
          Official Website:https://www.canadapleasure.com/

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups