Error Empty string passed to getElementById()

4 posts, 0 answers
  1. Support
    Support avatar
    13 posts
    Member since:
    Feb 2012

    Posted 25 Oct Link to this post

    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
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 27 Oct Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Support
    Support avatar
    13 posts
    Member since:
    Feb 2012

    Posted 31 Oct in reply to Viktor Tachev Link to this post

    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();
        }
    }
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 02 Nov Link to this post

    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.
Back to Top