CS1502: The best overloaded method match for 'System.Web.UI.WebControls.DataControlFi

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • r786amesh
    New Member
    • Dec 2007
    • 8

    CS1502: The best overloaded method match for 'System.Web.UI.WebControls.DataControlFi

    Code:
    string num;
                string id = string.Empty;
                Button  senderBox = sender as Button ;
                if (senderBox != null)
                {
                    id =senderBox.ID;
                }
     
                {
                    if (senderBox.ID == "Button0" | senderBox.ID == "Button1" | senderBox.ID == "Button2" | senderBox.ID == "Button3" | senderBox.ID == "Button4" | senderBox.ID == "Button5" | senderBox.ID == "Button6" | senderBox.ID == "Button7" | senderBox.ID == "Button8" | senderBox.ID == "Button9" | senderBox.ID == "Button10")
                    {
                        if (senderBox.Enabled == true)
                        {
                            GridView1.Columns[senderBox.CommandArgument].Visible = false;                        
                            senderBox.Enabled = false;
                            num = senderBox.ID.Substring(6);
                            num = num + 11;
                            Session["num"] = "Disabled";
                            Button btn = (Button)FindControl("Button" + num);
                            btn.Enabled = true;
                        }
                    }
                    else
                    {
                        if (senderBox.Enabled == true)
                        {
                            num = senderBox.CommandArgument;
                            num = num - 11;
                            GridView1.Columns[num].Visible = true;
                            BindGrid();
                            senderBox.Enabled = false;
                            Button btn = (Button)FindControl("Button" + num);
                            btn.Enabled = true;
                        }
                    }
                }
    Last edited by Plater; Dec 28 '07, 02:16 PM. Reason: added code tags
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    What line is that error being thrown on, and could you please post the full error name (it got caught off because you tried to use it as a title)

    It looks to me that an object is not the type you thought it would be.

    Comment

    Working...