This is a migrated thread and some comments may be shown as answers.

Error Empty string passed to getElementById()

3 Answers 391 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Support
Top achievements
Rank 2
Support asked on 25 Oct 2016, 07:40 AM
Good morning, if I try to open my site with Firefox I get several error messages that do not lock the site:

Empty string passed to getElementById().

on the file Telerik.Web.UI.WebResource.axd:2340:24422.

How can I fix it?

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 27 Oct 2016, 02:57 PM
Hello,

Based on the provided information it would be hard to determine where the error originates from. Moreover, note that getElementById() is a generic JavaScript method and is not directly related to our components.

With that said, would you send us the markup of the problematic page with the related server- and client-side code so we can examine it?


Regards,
Viktor Tachev
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Support
Top achievements
Rank 2
answered on 31 Oct 2016, 08:46 AM

Hi, thanks for the answer.

I made a small test case that shows the problem.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestTelerik.aspx.cs" Inherits="TestTelerik" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadImageGallery RenderMode="Lightweight" runat="server" ID="RadImageGallery1" DisplayAreaMode="LightBox" Width="100%"  >
            <ThumbnailsAreaSettings Height="250px" ThumbnailHeight="50px" ThumbnailWidth="50px" />
        </telerik:RadImageGallery>
    </form>
</body>
</html>

 

using System;
using System.Data.OleDb;
using System.IO;
using Telerik.Web.UI;
 
public partial class TestTelerik : Telerik.Web.UI.RadAjaxPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string strConnection = Application["StrConnection"].ToString();
        OleDbConnection myConnection = new OleDbConnection(strConnection);
        myConnection.Open();
 
        string StrSql = "SELECT [NickName], [Campo1], [Img1], [ID Utente], [Data Nascita], [Cod Segno] FROM Utenti WHERE [Campo2] = True AND [Campo3] = True AND [Campo4] = False AND [Campo5] = False ORDER BY Rnd(-10000000*TimeValue(Now())*[ID Utente])";
 
        OleDbCommand myCommand = new OleDbCommand(StrSql, myConnection);
        OleDbDataReader myReader = myCommand.ExecuteReader();
 
        while (myReader.Read())
        {
            int Eta = Tools.CalcolaEta(myReader.GetDateTime(myReader.GetOrdinal("Data Nascita")));
            ImageGalleryItem Img = new ImageGalleryItem();
            Img.Title = myReader["NickName"].ToString() + " " + Eta.ToString() + " anni";
            Img.Description = Tools.SegnoFromID(myReader.GetByte(myReader.GetOrdinal("Cod Segno"))) + "<br /><br />\"" + Tools.Get5Parole(myReader["Campo1"].ToString()) + "<br /><br /><center><a class=\"btn btn-primary btn-xs\" href=\"/annunci/single.aspx\" role=\"button\">Prova " + Application["NomeServizio"].ToString() + "</a></center>";
            Img.ImageUrl = "~/public/" + Tools.CreateHash(myReader["ID Utente"].ToString()) + "/" + (Convert.ToBoolean(Session["Verificato"]) ? "s" : "bs") + "-" + myReader["ID Utente"].ToString() + Path.GetExtension(myReader["Img1"].ToString());
            RadImageGallery1.Items.Add(Img);
        }
        myReader.Close();
 
        myConnection.Close();
    }
}
0
Viktor Tachev
Telerik team
answered on 02 Nov 2016, 03:20 PM
Hi,

If you would like to data-bind the RadImageGallery programmatically you should use the NeedDataSource event. Please examine the following resources that illustrate the approach:




Regards,
Viktor Tachev
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Ajax
Asked by
Support
Top achievements
Rank 2
Answers by
Viktor Tachev
Telerik team
Support
Top achievements
Rank 2
Share this question
or