CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Comma Error

  1. #1
    Join Date
    Jan 2009
    Posts
    177

    Comma Error

    I have the following code

    Code:
    
     protected  void Master_CheckedChanged(System.Object sender, System.EventArgs e)
         {
                checkAll(this, Left((CheckBox)sender).ID, 2), ((CheckBox)sender).Checked);
         }
    
    
         protected void checkAll(Control parent, string lintGrpid , Boolean lblnChecked )
         {
                
                foreach (Control child in parent.Controls)
                {
                    if(child.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBox")) 
                    {
                        if (Left((((CheckBox)child).ID, 11) = lintGrpid & "chkDetail")
                        {
                            ((CheckBox)child).Checked = lblnChecked;
                        }
                    }
                    if (child.Controls.Count > 0)
                    {
                        checkAll(child, lintGrpid, lblnChecked);
                    }
                }
         }
    For the master_checkedchanged, the error occured at the comma there.

    For the checkall, the error occured at the "Left" there and the syntax is "syntax error, ( is required) and also at the comma there.

    Can anyone advice on this?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Comma Error

    Post the code for the "Left" method.

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    210

    Re: Comma Error

    you are (trying) assigning, not comparing

    Code:
    if (Left((((CheckBox)child).ID, 11) .......=.......... lintGrpid & "chkDetail")

    Use ==

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured