using iTextSharp.text; RRS feed

  • Question

  • User643189141 posted


    When I upload use iTextSharp.text; displayed error:
    Listitem (newName));

    Server Error in '/Potni nalogi 2011' Application.

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0104: 'ListItem' is an ambiguous reference between 'System.Web.UI.WebControls.ListItem' and 'iTextSharp.text.ListItem'

    Source Error:

    Line 65:                             {
    Line 66: newName = string.Concat(sqlReader["Priimek"].ToString(), " ", sqlReader["Ime"].ToString());
    Line 67: ddlVoznik.Items.Add(new ListItem(newName));
    Line 68: ddlOdredil.Items.Add(new ListItem(newName));
    Line 69: }

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using DAL;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Data;
    using System.Web.Security;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Xml.Linq;
    using System.Globalization;
    using iTextSharp.text.pdf;
    using System.IO;
    using iTextSharp.text.html.simpleparser;
    using iTextSharp.text;

    I need this reference for creating the pdf document.

    Please help!

    Tuesday, November 9, 2010 6:48 AM

All replies

  • User-231977777 posted


    you can set as following :

    ddlVoznik.Items.Add(new System.Web.UI.WebControls.ListItem (newName));

    Or if ddlVoznik related to iTextSharp , use this :

    ddlVoznik.Items.Add(new iTextSharp.text.ListItem (newName));

    you can choose as  ddlVoznik means.

    Tuesday, November 9, 2010 7:02 AM
  • User643189141 posted


    Tuesday, November 9, 2010 7:19 AM