Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
how to access <asp:Listview id="chknew" runat="server " > in webmethod,,,

I used web method because
on checkbox indexselected change event , i filter listview and show results..this reloads/refreshes page which i dont want

but when i use web method, i cant access listview from there
Posted
Comments
Karthik_Mahalingam 29-Jan-14 7:32am    
you cant, but using some OOP we can try to do the functionality but not the control inside static method.
post your web method code..
maulikshah1990 29-Jan-14 7:33am    
In webmethod , i try as


DataTable dttemp_temp = (DataTable)HttpContext.Current.Session["SearchHotel"];

StringBuilder filter = new StringBuilder();
DataView dv = new DataView(dttemp_temp);

filter.Append(" rating_temp = '5'");

dv.RowFilter = filter.ToString();

dttemp_temp = dv.ToTable();

int rcnt_temp = dttemp_temp.Rows.Count;


ProductListList.DataSource = dttemp_temp;
ProductListList.DataBind();
Please reply to the Comment, don't add another comment. It won't notify the user.
maulikshah1990 29-Jan-14 8:04am    
waiting.....
or u suggest what is best way... but first of all , did u understand where i m stuck,,
for exp..u can see makemytrip.com, where when we search hotels,and get list of hotels, then when we use filters, it shows filtered list without page refresh

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