> Du deklarierst branchenListe ja zweimal...

Hallo Andreas, Danke. Hab ich korrigiert (s.u.) Hat aber leider nichts am Fehler 
gee�ndert ...

Der CodeBehind
.
.
using KiezAssembly;
.
.
.
void Page_Load()
 {      
  string strPageName = "neuer Benutzer";
  ArrayList branchenListe = new ArrayList();
  KiezUtilities branList = new KiezUtilities();
  branList.XmlDropDownList(strPageName, 1, ref branchenListe);
 //
 // letzte Zeile f�hrt zu:
 // System.NullReferenceException:
 // Object reference not set to an instance of an object.
        
    ddlBranche.DataSource = branchenListe;
    ddlBranche.DataBind();
  }


Die Klasse in der Assembly:

using System;
using System.Collections;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Data.OleDb;
using System.Web;
using System.Web.Mail;
using System.Xml;
using System.Xml.XPath;

namespace KiezAssembly
{
 public class KiezUtilities : Page  //HttpContext.Current.      
  {
   string strPfad;
     .
     .
     .
   public void XmlDropDownList
   (string strPageName, byte byteEbene, ref ArrayList branchenListe)
     {
      strPfad = Server.MapPath(CreatePath(byteEbene)
                + "db\\KiezTageskarte.mdb");
                
        XPathDocument objXPathDoc;
                
       try
       {
        objXPathDoc = new XPathDocument(strPfad);
         }
         catch (Exception ex)
         {
         divFehlermeldung.InnerHtml =
       this.Fehlerseite(strPageName, ex.ToString(), 1);
         pnlFormular.Visible = false;
         this.SendMail(ex.ToString());
         return;
         }
                
         XPathNavigator objXPNav = objXPathDoc.CreateNavigator();       
         XPathNodeIterator objXPIter;
         objXPIter = objXPNav.Select("descendant::Branche");
                        
         while (objXPIter.MoveNext())
         {
         branchenListe.Add(objXPIter.Current.Value);        
         }
     }
                
                
   }
}




| [aspdedotnet] als [email protected] subscribed
| http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.dotnetgerman.com/listen/aspDEdotnet.asp

Antwort per Email an