Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Respected Sir,


my code in c#

C#
bool a = ((CheckBox)(GridView1.HeaderRow.FindControl("chkSelect"))).Checked; 


this code is not work.
Error -'CheckBox' does not contain a definition for 'Checked' and no extension method 'Checked' accepting a first argument of type 'CheckBox' could be found (are you missing a using directive or an assembly reference?)

where is problem?

please solve it.



Thanks
Mahendra Kumar Das
Posted
Updated 14-Feb-12 1:18am
v2

1 solution

Sory dude i can give code in php if possible convert into ASP.NET


PHP
if(isset($_POST['delete']))  //[hear write button_click method]
{
	$count=$_POST['count'];
	//$del_id=$_POST["hiddenfield"];
	for($j=1;$j<$count;$j++)
	{
			if(isset($_POST['check_'.$j.'']))
			{
				$k=$_POST['check_'.$j.''];
				$sql = "DELETE FROM equipment WHERE eid='$k'";  \\[insert command]
				$result1 = mysql_query($sql);
				echo"<script>javascript:history.back();</script>";
				echo"<script>navigate('indexn.php?page=equipmentable&folder=admin')</script>";
			}
	}

	/*if($result1)
	{
		echo "<meta http-equiv=\"refresh\" content=\"0;URL=equipmentable.php\">";
	}
	else
	{
		echo"not successful";
	}*/
	
}



javascript is billow i thinh it will usefull


JavaScript
<script type="text/javascript" language="javascript">
	function DeleteConfirmation()
	{
	if (confirm("Are you sure,you want to delete selected records ?")==true)
	   return true;
	else
	   return false;
	}
	function theChecker()
{
	if(document.form1.theCheck.checked==false)
		{
		document.form1.deleteid.disabled=true;
		}
	else
		{
		document.form1.deleteid.disabled=false;
		}
}

</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900