none
Error: Missing partial Modifier on declaration of type...

    Question

  • Hi there,

     

    Can someone give me a hand?

     

    I had below codes, but prompt me an error...

     

    namespace FindUserGroup

    {

    public class ViewUser : System.Web.UI.WebControls.WebParts.WebPart

    {

    public ViewUser() { }

    protected TextBox txtName;

    protected Button btnSearch;

    protected GridView gvFindGroup;

     

    void btnSearch_Click(object sender, EventArgs e)

    {............

     

    By default, C# will give me:

    "public partial class ViewUser : System.Web.UI.Page",

    when i change it to:  "public class ViewUser : System.Web.UI.WebControls.WebParts.WebPart", it prompts me an error of "Missing partial modifier on declaration of type........, another partial declaration of this type exists".

     

    If i change back to "Partial" then those "protected..." shows error. I know this must be something to do with: public, private, protected ...kind of stuff....

     

    Thanks and cheers..........

     

     

     

    Wednesday, August 01, 2007 1:22 PM

Answers

  • Do you have Usercontrols/Web Pages(C#) migrated from previous version of VS (2003 to 2005)?

    It does creates ".aspx.designer.cs" files for you... and the classes are declared in that file too... with

    "public partial class"..

     

    In my case I have to add (or make sure) the partial word  in between public and class on all those pages/user conrtols...

     

    I hope it will help somebody who is having the similar issues...

     

    Cheers,

     

    Thursday, September 20, 2007 6:48 AM

All replies

  • Do you have Usercontrols/Web Pages(C#) migrated from previous version of VS (2003 to 2005)?

    It does creates ".aspx.designer.cs" files for you... and the classes are declared in that file too... with

    "public partial class"..

     

    In my case I have to add (or make sure) the partial word  in between public and class on all those pages/user conrtols...

     

    I hope it will help somebody who is having the similar issues...

     

    Cheers,

     

    Thursday, September 20, 2007 6:48 AM
  • 1. I have a solution which I migrate from VS2003 to VS2008. After that all the .cs files has been accompanied with .Designer.cs

     

    2. When I tried to compile, I received the same error:

     

    Error 1 Missing partial modifier on declaration of type .EquipmentData'; another partial declaration of this type exists \ShareProjects\\EquipmentData.cs 23 18 Common


    3. Could someone explain : how to get over the .Designer.cs issue ? If I add partial between the public and class, I will received another error:

     

    Wednesday, April 02, 2008 4:06 AM