<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[errore object not reference on instance of object ajaxToolkit:ReorderList]]></title><description><![CDATA[<p dir="auto">Ciao a tutti ho un problema con ReorderList. Praticamente ho una lista di articoli che popolo con un click su un bottone che prende da delle select box dei filtri. C'è anche un bottone ordina in modo random che mette gli elementi della lista in modo random. Ed infine c'è un bottone che salva l'ordinamento. Il click sul bottone random funziona e dopo se effettuo un salvataggio mi salva correttamente.. La lista viene popolata in modo corretto sembra che funzioni tutto eccetto che per il drag and drop che mi genera questo popup: "Reorder failed see details bellow:\r\n\r\n Object reference not set to an instance of an object". Non so più come procedere. Vi allego il codice:</p>
<p dir="auto">REORDERLIST</p>
<pre><code>&lt;ajaxToolkit:ReorderList ID="reorder_articoli" runat="server" SortOrderField="ordine" 
                                     AllowReorder="true" DataSourceID="SqlDataSource1" DataKeyField="id_articolo" CssClass="reorderlist"
                                     &gt;
                                     &lt;DragHandleTemplate&gt;
                                        &lt;div style="height: 20px; width: 25px; cursor: pointer;"&gt;
                                            &lt;asp:Image ID="Image1" runat="server" ImageUrl="~/admin/img/drag.png" BorderWidth="0" /&gt;
                                        &lt;/div&gt;
                                    &lt;/DragHandleTemplate&gt;
                                     &lt;ItemTemplate&gt;
                                     &lt;asp:Label ID="lb_articolo" runat="server" Text='&lt;%#Eval("id_articolo") %&gt;' /&gt;
                                     &lt;/ItemTemplate&gt;
                                   
                                 &lt;/ajaxToolkit:ReorderList&gt;
</code></pre>
<p dir="auto">SQL DATA SOURCE</p>
<pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server"     ConnectionString="&lt;%$ ConnectionStrings:mycons %&gt;"
     ProviderName="&lt;%$ ConnectionStrings:mycons.ProviderName %&gt;"    
     UpdateCommand="UPDATE [AJAX] SET ordine=@ordine WHERE [id_articolo]=@original_id"&gt;       
    
    
    
   
    &lt;UpdateParameters&gt;
        &lt;asp:Parameter Name="ordine" Type="Int32" /&gt;
        &lt;asp:Parameter Name="original_id" Type="string" /&gt;
    &lt;/UpdateParameters&gt;
    &lt;/asp:SqlDataSource&gt;
</code></pre>
<p dir="auto">CLICK SALVA</p>
<pre><code>Protected Sub btn_salva_ordinamento_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_salva_ordinamento.Click        Try
            connessione = DBUtil.GetOdbcConnection
            connessione.Open()


            Dim mc As OdbcCommand = New OdbcCommand
            mc.Connection = connessione


            rows = DirectCast(Session("rows"), ArrayList)


            For index As Integer = 1 To rows.Count
                mc.CommandText = "UPDATE articoli set ordine = " + index.ToString + " where id_articolo = '" + rows(index - 1) + "'"
                Dim r As Integer = mc.ExecuteNonQuery
            Next
            connessione.Close()
            LogManager.InsertLogAzione("Articolo.Ordinamento", "Ordinamento articoli = Ordinamento degli articoli di " + categorie.getCategoria + " / " + categorie.getGruppo + " / " + categorie.getSottogruppo)
        Catch ex As Exception
            ErroreManager.LogErrore(ex)
        End Try
        Response.Redirect(Request.Url.ToString)
    End Sub
</code></pre>
<p dir="auto">CLICK PER ORDINAMENTO RANDOM</p>
<pre><code>Protected Sub btn_random_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_random.Click        Try
            SqlDataSource1.SelectCommand = "SELECT id_articolo,nome, ordine from articoli where id_cat = '" + categorie.getCategoria + "' and id_gru = '" + categorie.getGruppo + "' order by rand()"
            SqlDataSource1.DataBind()
            reorder_articoli.DataSourceID = "SqlDataSource1"
            reorder_articoli.DataBind()
            For Each r As AjaxControlToolkit.ReorderListItem In reorder_articoli.Items
                Dim lb_articolo As Label = DirectCast(r.FindControl("lb_articolo"), Label)
                'MsgBox(lb_articolo.Text)
                rows.Add(lb_articolo.Text)
            Next
            Session("rows") = rows
        Catch ex As Exception
            ErroreManager.LogErrore(ex)
        End Try
    End Sub
</code></pre>
<p dir="auto">CLICK FILTRA PER VISUALIZZARE L'ELENCO</p>
<pre><code>Protected Sub lkbtnFiltra_Click(sender As Object, e As EventArgs) Handles lkbtnFiltra.Click        If categorie.getCategoria &lt;&gt; "0" And categorie.getGruppo &lt;&gt; "0" Then
            SqlDataSource1.SelectCommand = "SELECT id_articolo,nome, ordine from articoli where id_cat = '" + categorie.getCategoria + "' and id_gru = '" + categorie.getGruppo + "' order by ordine asc"
        Else
            SqlDataSource1.SelectCommand = "SELECT id_articolo,nome, ordine from articoli order by ordine asc"
        End If
        SqlDataSource1.DataBind()
        reorder_articoli.DataSourceID = "SqlDataSource1"
        reorder_articoli.DataBind()
        For Each r As AjaxControlToolkit.ReorderListItem In reorder_articoli.Items
            Dim lb_articolo As Label = DirectCast(r.FindControl("lb_articolo"), Label)
            'MsgBox(lb_articolo.Text)
            rows.Add(lb_articolo.Text)
        Next
        Session("rows") = rows
    End Sub
</code></pre>
<p dir="auto">Vi ringrazio in anticipo<br />
Iulia</p>
]]></description><link>https://dev.connect.gt/topic/208908/errore-object-not-reference-on-instance-of-object-ajaxtoolkit-reorderlist</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 06:21:14 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/208908.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Dec 2014 10:47:22 GMT</pubDate><ttl>60</ttl></channel></rss>