0

I'm trying to make some browser notifications with push.js library and vb.net Image of my notification

The notification works but my problem is I want multiple notifications at same time, if I need it. the data is taken from my database and usually it'll be more than one data row.

My problem is, it only show one notification

For Each t_dtt_row As DataRow In t_dtt_notificaciones.Rows
            str_url_img = "http://finalbca.16mb.com/homepageimages/notificationicon.png"
            If t_dtt_row("nuevo") Then
                t_str_script = "Push.create('Tienes una nueva notificación', {" & _
                               "body: '" & t_dtt_row("notificacion") & "'," & _
                               "icon: '" & str_url_img & "'," & _
                               "timeout: 6000" & _
                               "}); "
            End If
            ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "notificar", t_str_script, True)
        Next

I'm using a "for" but I only get one notification this is an example of what I need enter image description here

Some ideas? if i do it with html or aspx and js and fixded information works but when I include it with vb.net only shows one.

krlosruiz
  • 113
  • 3
  • 11
  • Oh my god don't print javascript like this. Make an ajax call or something. – Phiter Jan 11 '18 at 17:14
  • I apreciate your opinion I did it like this cause it works, It is a way to execute js from vb.net, Can tou give an example? thank for answer – krlosruiz Jan 11 '18 at 17:31
  • are you sure you don't have more than one...and they are all appearing in the same spot? – Ctznkane525 Jan 11 '18 at 18:17
  • Yes, Im' sure I think it is for the way I excecute js from vb with ScriptManager.RegisterClientScriptBlock(..., let me explain I have a datatable with info from database when I excecute the push for the notification only work with first row but it doesn't show the others, debuged in visual studio and this assumes that work but in the browser only show one notification – krlosruiz Jan 11 '18 at 19:12

0 Answers0