it does the job of checking up the unchecked checkboxes and viceversa
inside the grid .
[WebMethod]
public void GetAllCheckBoxesChecked(CheckBox chkCheckAll, DataGrid
dgDetails,string chkItem)
{
if (chkCheckAll.Checked==true)
{
foreach(DataGridItem dgi in dgDetails.Items)
{
CheckBox checkedRowItem =(CheckBox)dgi.FindControl(chkItem);
if(checkedRowItem.Checked!=true)
{
checkedRowItem.Checked=true;
}
}
}
else
{
foreach(DataGridItem dgi in dgDetails.Items)
{
CheckBox checkedRowItem =(CheckBox)dgi.FindControl(chkItem);
if(checkedRowItem.Checked!=false)
{
checkedRowItem.Checked=false;
}
}
}
}
but it gives me the error when i try to reference in my project as,
The property 'ClientID' on type 'System.Web.UI.Control' cannot be
serialized because it is decorated with declarative security permission
attributes. Consider using imperative asserts or demands in the
property accessors.
please can u tell me how to avoid this error...
Thanks
Prasad.Yes, don't try to create a WebMethod that takes UI elements as parameters.
Create one that takes the values from those elements instead.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
<prasadrmarathe@.gmail.com> wrote in message
news:1145888003.104750.227650@.t31g2000cwb.googlegr oups.com...
> Hi i have Following webmethod inside my webservice
> it does the job of checking up the unchecked checkboxes and viceversa
> inside the grid .
>
> [WebMethod]
> public void GetAllCheckBoxesChecked(CheckBox chkCheckAll, DataGrid
> dgDetails,string chkItem)
> {
> if (chkCheckAll.Checked==true)
> {
> foreach(DataGridItem dgi in dgDetails.Items)
> {
> CheckBox checkedRowItem =(CheckBox)dgi.FindControl(chkItem);
> if(checkedRowItem.Checked!=true)
> {
> checkedRowItem.Checked=true;
> }
> }
> }
> else
> {
> foreach(DataGridItem dgi in dgDetails.Items)
> {
> CheckBox checkedRowItem =(CheckBox)dgi.FindControl(chkItem);
> if(checkedRowItem.Checked!=false)
> {
> checkedRowItem.Checked=false;
> }
> }
> }
> }
>
> but it gives me the error when i try to reference in my project as,
>
> The property 'ClientID' on type 'System.Web.UI.Control' cannot be
> serialized because it is decorated with declarative security permission
> attributes. Consider using imperative asserts or demands in the
> property accessors.
>
> please can u tell me how to avoid this error...
>
> Thanks
> Prasad.
0 comments:
Post a Comment