Thursday, October 6, 2011

Missing partial modifier on declaration of type; another partial declaration of this type exists

ERROR:-
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".

SOLUTIONS:-
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...

No comments:

Post a Comment