The type or namespace name 'ListView' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?) error

I have created a ASPX form with a ListView See below:

<form id="form1" runat="server">

<asp:ListView id="ProductList" runat="server" >

<LayoutTemplate>

<h3>Product Listing</h3>

<blockquote>

<asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>

</blockquote>

</LayoutTemplate>

<ItemSeparatorTemplate>

<hr />

</ItemSeparatorTemplate>

<ItemTemplate>

<h4><%#Eval("ProductName")%> (<%# Eval("CategoryName") %>)</h4>

Available at <%#Eval("UnitPrice", "{0:c}")%>,

with <%#Eval("QuantityPerUnit")%>.

</ItemTemplate>

</asp:ListView>

</form>

And my code behind is the following (I did include the System.Web.UI.WebControls namespace):

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

for (int i = 0; i < 5; i++)

{

product =
new Product();

product.ProductName = "Product" + i.ToString();

product.CategoryName = "Category" + i.ToString();product.UnitPrice = (float) i;

list.Add(product);

}

this.ProductList.DataSource = list;this.ProductList.DataBind();

}

}

Now when I try to build the project I receive the error:  The type or namespace name 'ListView' does not exist in the namespace 'System.Web.UI.WebControls'

Also, it appears that the ProductList ListView does not support the DataSource or DataBind property and method. Does anyone have any idea why I can not bind to the ListView and if so how do I bind to the ListView? 

Thanks,

Steve 

 

0
sholdorf
9/10/2008 1:10:21 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

5 Replies
3757 Views

Similar Articles

[PageSpeed] 9

What framework version are you working with?


Thanks,
Max
Let Me Google That For You!
0
bullpit
9/10/2008 1:41:02 PM

3.5 SP 1

0
sholdorf
9/10/2008 1:51:28 PM

Can you please also check the target framework of this particular application? Also, try adding a reference to System.Web.Extensions in your application.


Thanks,
Max
Let Me Google That For You!
0
bullpit
9/10/2008 1:57:38 PM

Target application is 3.5

System.Web.Extensions is there.

Still have problem?

0
sholdorf
9/10/2008 3:23:07 PM

The problem is that I was not using the 3.5 version of the System.Web.Extension reference.

0
sholdorf
9/10/2008 6:27:57 PM
Reply:

Similar Artilces:

The type or namespace name 'ScriptManager' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)
Hello, I am trying to add ASP.NET AJAX functionality to an existing project. Here's what I did: I have downloaded and installed the AJAX executable from here: http://ajax.asp.net/ I have done an iisreset I have opened my existing project and modified the Web.config using this guide: http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx I opened my MasterPage and I added <asp:ScriptManager ID="ScriptManager1" runat="server" /> just below the form-tag Whenever I try to build, I get this error: Error 36 The type or namespace name 'ScriptManager' does not exist in the nam...

The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
 Hi everybody,I have a Web app project that uses Linq. I am receiving the following error:The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)in the line:using System.Data.Linq;The reference points to the correct file and in other projects everything is fine. the projects builds successfully and gives this error right after that.If someone has an idea what is happening or some previous experience with such an error - please.Thank you in advance.  Bulgaria Did you install Linq on the server? Jef...

CS0234: The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?)
Anyone get this, i added system.windows.form to my references in my project and still get this... CS0234: The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?) Line 3: using System.Collections; Line 4: using System.ComponentModel; Line 5: using System.Windows.Forms; //ERROR Line 6: using System.Data; Line 7: You're compiling from the command line, right? You have to add a reference to the System.Windows.Forms.dll to the compile line, using the /r switch. Eno...

CS0234: The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?) #2
I included the <%@ import Namespace="System.Windows" %> directive in the code file, but for some reason I'm getting this error. I know it's an issue of assembly referencing and I can solve this in VS.NET but I don't know how to reference it right in WebMatrix. Is it true that all I have to do is include the above aforementioned directive in my code page and I'm set to go or do I need to do some configuration work? Help... Anyone... Please......

Compiler Error Message: CS0234: The type or namespace name 'Global' does not exist in the namespace 'UChat' (are you missing an assembly reference?)
Compiler Error Message: CS0234: The type or namespace name 'Global' does not exist in the namespace 'Chat' (are you missing an assembly reference?)  suggest the above error   i am having Global.asax file and codebehind Global.asax.cs under App_code folder..in my local system it working fine but  when i copy paste the code in server it showing the error ...  Hi, senthil_os: Compiler Error Message: CS0234: The type or namespace name 'Global' does not exist in the namespace 'Chat' (are you missing an assembly reference?) I ...

The type or namespace name 'Core' does not exist in the namespace 'YASUTech.QRDN.WebEditor' (are you missing an assembly reference?)
Hi,I am getting the following error message - "The type or namespace name 'Core' does not exist in the namespace 'YASUTech.QRDN.WebEditor' (are you missing an assembly reference?) " - when I try to build the web application I had migrated from VS2003 to VS2005.--------------------------------------- In the web application i had created using 1.1 Framework I had created a folder - "Core" - which contained 2 web pages and one class file.The following occured when I migrated by making use of the Conversion Wizard - 1. A folder "Core" was create...

Error 1 The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\asse
Once I build project. I encounter this error. Does someone experience this error?Error    1    The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll'    D:\Source Code\Linq_Lesson5\Default.aspx    1    1    D:\Source Code\Linq_Lesson5\  It appears tha...

The type or namespace name 'Configuration' does not exist in the namespace 'System.Web'
Hi,  I'm trying to use the the System.Web.Configuration namespace but keep getting this error:   The type or namespace name 'Configuration' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)   Do you have any idea what could be the reason? Hi,You need to add System.Configuration DLL via "Add Reference" dialog box. Right click References and select Add Reference, then select System.Configuration under the .NET tab.Hope this helps,Vivek Social Networking Platform in ASP.NET || Join now: CodeASP.NET Community...

The type or namespace name 'HttpContext' does not exist in the namespace 'System.Web'
Hi thereI've created a wee class library with which to create a dll used by my web app. A class in the library needs to use System.Web.HttpContext.Current.Server.MapPath in order to get the physical location of a file regardless of where the application currently is.When I'm coding the class, Intellisense tells me that System.Web only has three members: AspNetHostingPermissionAspNetHostingPermissionAttributeAspNetHostingPermissionLevelI ignore it and type in the rest of the 'MapPath' stuff, but when I build the library I get the error I've used as the title of this thread...

Error: Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField'
Hello, I am getting the following error during compiliation. Any suggestions to fix it. Thanks. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' protected void gvEvents_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvEvents.Rows[index]; string sID; ButtonField btn; if (selectedRow.RowType == DataControlRowType.DataRow) { sID = ((ButtonField)selectedRow.FindControl("ID")).DataTextFi...

Error "CS0234: The type or namespace name 'Data' does not exist in the namespace 'System'"
Dear all,the following web site ran for months without troubles http://www.fotovoltaico.sanzeno.org/StoricoRS.aspxSuddenly yesterday I started getting the error you can see switching to that site. I am really getting crazy wondering what happened, but I have no idea. Do you have any suggestion? Thank you in advancePierluigi ...

Error Serializing Value 'System.Web.UI.WebCOntrols.TreeNode' of type 'System.Web.UI.WebCOntrols.TreeNode'
Hi, I am  getting the error stated in the subject when i am storing a TreeNode in a ViewState and then using it as follows if (ViewState["ProductCounty"]!=null) { TreeNode _productCountyNode = DataTree.FindNode(((TreeNode)ViewState["ProductCounty"]).ValuePath); _productCountyNode.Expand(); } what could be causing this error? Hi, I believe TreeNode isn't serializable in a way its required for objects which can be put to ViewState - as reference - (TreeNode implements IStateManager and is meant to work together with TreeView itself saving it...

The type or namespace name 'SqlServer' does not exist in the namespace 'System.Data'
Hi, I have created a .net class library and i include the namespace : using System.Data.SqlServer but when i build my .net class library i get the folowing error: The type or namespace name 'SqlServer' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)    your help is highly appreciated Best regards System.Data.SqlClient not System.Data.SqlServerArticles and news on ASP/ASP.NETASPCode.net Thank you for the support I am Creating a Trigger using Managed Code in SQL Server so i create a class contains the following: using Syst...

The type name 'XmlDocument' does not exist in the type 'System.Web.UI.WebControls.Xml'
Hi Guys,  I am trying to convert a desktop app i wrote in VB to a web app written using C# .Net. The program checks XML entered against a XML schema and validates it. I have used the below code to validate the XML but am receiving the error in the title of this thread: {Xml.XmlDocument xmlDoc = new Xml.XmlDocument();  try{  xmlDoc.LoadXml(TextBox1.Text);}  catch (Exception ex){  TextBox2.Text = (ex.Message);  return;}} Why would this error be occuring? I have the below at the top of my aspx.cs page: using System;using System.Drawing;using System.Data;usin...

Web resources about - The type or namespace name 'ListView' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?) error - asp.net.presentation-controls

Resources last updated: 12/10/2015 3:37:56 AM