tags:

views:

7

answers:

0

My code is as bellow ,i have a xml file in xml folder in root i get an error type or namespace Movie not found.

I think i am following what wrox book has said i get this error,can anyone help me out.

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


public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        /*var query = from m in XElement.Load(MapPath("XML/Movie.xml")).Elements("Movie") 
                    select m;*/
        var query = from m in XElement.Load(MapPath("XML/Movie.xml")).Elements("Movie")
                    select new Movie { Title=m.Element("Title") };
        this.GridView1.DataSource = query;
        this.GridView1.DataBind();
    }
}