[Mono-bugs] [Bug 585968] New: XmlDataSource does not update cache when DataFile property changes.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Mar 5 16:21:59 EST 2010



           Summary: XmlDataSource does not update cache when DataFile
                    property changes.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: kuritsu at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created an attachment (id=346901)
 --> (http://bugzilla.novell.com/attachment.cgi?id=346901)
MonoDevelop project that demostrates the bug.

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; es-MX; rv:
Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5

I have an ASP.NET web page with a GridView and an associated XmlDataSource.
When I change during a postback the value of the DataFile property of the
XmlDataSource, and then invoke gridView.DataBind(), the data of the grid
remains the same. I also tried with other databound controls like DropDownList
and so on, so the problem is the XmlDataSource, which does not update its cache
when the DataFile or Data properties change.

Reproducible: Always

Steps to Reproduce:
1. Create a C# ASP.NET project using MonoDevelop.
2. In the default page, inside the runat="server" form tag, put the following

<asp:GridView ID="gvData" runat="server" DataSourceID="xdsData"
AutoGenerateColumns="false" >
        <asp:BoundField DataField="name" HeaderText="Name"
                    SortExpression="name" />
        <asp:BoundField DataField="description" HeaderText="Description" 
            SortExpression="description" />
<asp:XmlDataSource ID="xdsData" runat="server" DataFile="~/data1.xml"
XPath="/root/element" />
<asp:Button id="btnChange" runat="server" Text="Change XML!"
OnClick="btnChange_Click" /

3. In the code behind, inside the page class, put the following code:

protected void btnChange_Click (object sender, System.EventArgs e)
    Session["DataFile"] = ((string)Session["DataFile"] == "~/data2.xml") ?
"~/data1.xml" : "~/data2.xml";
    xdsData.DataFile = (string)Session["DataFile"];

4. Add two XML files in the root folder of the project:


    <element name="John" description="administrator" />
    <element name="David" description="art director" />
    <element name="Anna" description="finances" />


    <element name="Pedro" description="peon" />
    <element name="Juan" description="alfil" />
    <element name="Troya" description="torre" />

5. Run the web site and enter the Default Page.

6. Click the Change XML button several times and see what happens.
Actual Results:  
No changes. The grid still shows the same data.

Expected Results:  
The data of the grid changes every time the button is clicked.

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

More information about the mono-bugs mailing list