-
May 24th, 2010, 09:26 PM
#1
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?
-
May 25th, 2010, 01:56 PM
#2
Re: Comma Error
Post the code for the "Left" method.
-
May 26th, 2010, 12:08 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|