Web Service Problem

P

prasadrmarathe

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.
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,172
Latest member
NFTPRrAgenncy
Top