You may be trying to access the
non-static
property. But BTW your code is running good at my end. Where do you have written this code in your VewComplaint.aspx.cs and make sure you are getting the exception in the same line, then we can serve you better.
Have you written something like this:
namespace WebApplication1
{
public partial class ViewComplaint : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button b = (Button)((ViewComplaint)Page).FindControl("transitionStageBtnm");
}
}
}
the above code is running fine at my end. Make sure you
don't have written something like this:
namespace WebApplication1
{
public partial class ViewComplaint : System.Web.UI.Page
{
Button b = (Button)((ViewComplaint)Page).FindControl("transitionStageBtnm");
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
this will give the error:
Error 1 An object reference is required for the non-static field, method, or property 'System.Web.UI.Control.Page.get'
hope it helps :)