Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. [OperationContract]
  2.  
  3. public List<LightPh> GetI()
  4. {
  5.  
  6. ... here i read a database and populate a list of LigthPH
  7. }
  8.  
  9. public class LightPh
  10. {
  11.  
  12.  
  13. public int IdImagen { get; set; }
  14. public string nombre { get; set; }
  15. public int IdProd { get; set; }
  16. public byte[] imag { get; set; }
  17. public bool isp { get; set; }
  18.  
  19.  
  20. }
  21.  
  22. <asp:ScriptManager ID="ScriptManager1" runat="server">
  23. <Services>
  24. <asp:ServiceReference Path="Serv/JavaAjax.svc" />
  25. </Services>
  26. </asp:ScriptManager>
  27.  
  28. <script type ="text/javascript">
  29. var i = 0;
  30. var imid = 1;
  31. var l = 0;
  32. var re;
  33.  
  34. function GetValueFromServer() {
  35.  
  36. JavaAjax.GetI(onSuccess, onFailure);
  37.  
  38. }
  39.  
  40. function onSuccess(result) {
  41. l = result.length;
  42. re = result;
  43. go();
  44. }
  45. function go() {
  46. if (l > 0) {
  47. document.getElementById('TextBox1').value = re[0].nombre;
Add Comment
Please, Sign In to add comment