Gaurav Raj

Gaurav Raj

  • NA
  • 475
  • 89.4k

calling code behind function from javascript

Sep 25 2017 4:57 AM
i make this function
  1. public int seemore(int a)  
  2. {  
  3. System.Threading.Thread.Sleep(5000);  
  4. var count = cs.da.Home2Procedure(Convert.ToInt32(Session["Id"])).Count();  
  5. HiddenField1.Value = (Convert.ToInt32(HiddenField1.Value) + a).ToString();  
  6. int tmpskip = Convert.ToInt32(HiddenField1.Value);  
  7. if (Convert.ToInt32(HiddenField1.Value) <= count)  
  8. {  
  9. var q = cs.da.Home2Procedure(Convert.ToInt32(Session["Id"])).Skip(tmpskip).Take(4);  
  10. DataList1.DataSource = q;  
  11. DataList1.DataBind();  
  12. foreach (DataListItem dli in DataList1.Items)  
  13. {  
  14. DataList text = (DataList)dli.FindControl("DataList2");  
  15. Literal litral = (Literal)dli.FindControl("litBlogId");  
  16. LinkButton link = (LinkButton)dli.FindControl("TotalLike");  
  17. UpdatePanel up = (UpdatePanel)dli.FindControl("UpdatePanel1");  
  18. if (text.Visible)  
  19. {  
  20. int bid = Convert.ToInt32(litral.Text);  
  21. var q1 = cs.da.CommentsProcedure(bid).OrderByDescending(oo => oo.C_Id).Take(3).Reverse();  
  22. text.DataSource = q1;  
  23. text.DataBind();  
  24. }  
  25. var q2 = cs.da.TotalLikeNameProcedure(Convert.ToInt32(litral.Text));  
  26. // skip = DataList1.Items.Count;  
  27. //up.Update();  
  28. }  
this function are in aspx.cs page
 
how can I call with javascript
 
please help guys

Answers (5)