asp.net - How to access Page Controls value from C# webmethod -
i'm using c# asp.net web form application. using asp grid view control pages. once add ajax method c# web method capture data in web page. in c# web method can't capture grid view records. it's shows null always. how can records in web method. this code: [webmethod] public bool validategrid(string rowindex, string cellindex) { homedefault pagemethods = new homedefault(); pagemethods.validategridviewcontrols(convert.toint32(rowindex), convert.toint32(cellindex)); return true; } private void validategridviewcontrols(int rowindex, int cellindex) { foreach (gridviewrow row in grvprogram.rows) { } } in case grvprogram.rows alaways null. please me sort out issue, there 2 issues going experience current implementation: 1) zaki pointed out in comments, [webmethod] should public static bool validategrid(string rowindex, string cellindex) 2) suspicion homedefault pagemethods = new homedefault(); aspx page code-behind class. when ...