[Mono-bugs] [Bug 409492] New: ASP.Net XmlDataSource "Object reference not set to

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jul 16 07:10:11 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=409492


           Summary: ASP.Net XmlDataSource "Object reference not set to
           Product: Mono: Compilers
           Version: SVN
          Platform: 32bit
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: christian.schwerdtfeger at googlemail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


This Testcase was developed with Visual Web Developer 2005 Express under
Windows 2000. On this system the test is running without any problems.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        XmlDataSource xmlds = new XmlDataSource();
        xmlds.DataFile = Server.MapPath("~/dialogbeispiel.xml");
        XmlDocument xmldoc = xmlds.GetXmlDocument();
        XmlNodeList xmlnl = xmldoc.GetElementsByTagName("button");

        foreach (XmlNode node in xmlnl)
        {
            Button tmp = new Button();
            tmp.Text = node.FirstChild.InnerText;
            tmp.ID = node.ChildNodes[1].InnerText;
            tmp.OnClientClick = "alert(\"" + tmp.Text + " pressed\")";
            PlaceHolder1.Controls.Add(tmp);
        }

    }


Under Mono I receive the following Error:

Object reference not set to an instance of an object

Description: HTTP 500. Error processing request.
Stack Trace:
System.NullReferenceException: Object reference not set to an instance of an
object
at System.Web.UI.WebControls.XmlDataSource.GetDataKey () [0x00000]
at System.Web.UI.WebControls.XmlDataSource.GetXmlDocu mentFromCache ()
[0x00000]
at System.Web.UI.WebControls.XmlDataSource.GetXmlDocu ment () [0x00000]
at _Default.Page_Load (System.Object sender, System.EventArgs e) [0x00000]
at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00000]
at System.Web.UI.Control.LoadRecursive () [0x00000]
at System.Web.UI.Page.ProcessLoad () [0x00000]
at System.Web.UI.Page.ProcessPostData () [0x00000]
at System.Web.UI.Page.InternalProcessRequest () [0x00000]
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]
Version information: Mono Version: 2.0.50727.42; ASP.NET Version: 2.0.50727.42 


The file "dialogbeispiel.xml" is readable (tested with a
System.IO.StreamReader)
on the OpenSuse-System.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list