title: How do I call a method that is in the webpart class file, from a usercontrol in SharePoint 2007?
body: <p>I've followed the instructions in this MSDN article: <a href="http://msdn.microsoft.com/en-us/library/dd206945.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/dd206945.aspx</a></p>
  
  <p>Is it possible to call a method that is in the myWebPart.cs file, from the MyUserControl.ascx file?  I don't seem to have intellisense of the methods in the myWebPart.cs unless I do:</p>
  
  <pre><code>myWebpart mywbprt = new myWebpart();
  mywbprt.myMethInWebPartcs();
  </code></pre>
  
  <p>However that gets the error, and does not compile: </p>
  
  <pre><code>Error   2   'myWebpart' is a 'namespace' but is used like a 'type'
  </code></pre>
  
  <p>The myWebPart.cs and MyUserControl.ascx share the same namespace, and I thought that would be enough to call the methods in myWebPart.cs in the usercontrol, but apparently not?</p>
  
  <p>Am I missing some intricacy of SharePoint?</p>