What is wrong with code

</asp:DataList>

Line 41: <ItemTemplate>
Line 42: ProductName<asp:Label id="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem "ProductName") %>'></asp:Label>
Line 43: </ItemTemplate>
Line 44: </asp:DataList>
I am doing DataList and Templates exercise and I get the message that something is wrong with line 42 DataItem not a member of 'System.Web.UI.Control'. What do I change???
Thanks again
0
dunner7
9/14/2004 2:25:36 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
442 Views

Similar Articles

[PageSpeed] 35

You've got </asp:DataList> twice..... so unless you are embedding them (I haven't done the exercise you mention.

And also, you should have
DataBinder.Eval(Container.DataItem, "ProductName")
The comma is missing.
0
Makofo
9/14/2004 3:26:35 AM
Reply:

Similar Artilces:

Setting width for .net controls in code(.aspx) page using function call in code behind..
Hi,  Currently I am trying to set the width of the asp.net Table as follows. <asp:Table width="<%=GetWidth()%>" >   and code behind protected Unit GetWidth() { return Unit.Percentage(50); }     It's not working. I know that it works if I set the width complete on some page event(like page_load) of code behind....   Is there a way to maintain the same syntax like calling code behind function in design page...i.e. calling function of .aspx.cs in .aspx page and assign the width as shown above.   Thanks and regards, Giridhar...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

Translate c#.net code to vb.net code
Hi I can usually do the translation myself, but this time I am a bit stumped  Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder. class UrlRewriteModule : IHttpModule{    public void Dispose()    {        // Nothing to dispose    }    public void Init(HttpApplication context)    {        context.BeginRequest += new EventHandler(context...

How to convert C#.Net code to VB.Net code ???...
HI, i was searching something new, then i suddenly find some tips to convert C#.Net code to VB.Net but i did not do well. i am puttint its url here plz tell me how to convert C#.Net code to VB.Net. http://www.dotnetspider.com/code/C-273-Convert-C-VB-NET.aspx Jasim...Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA ) It would be better if you write the problem you having, while converting from C# to VB.NET. You cannot completely rely on online converters. ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Bl...

What is wrong with my Control collection codes?
I use C# implement one of ASP.NET page containing ListBoxs, DropDownLists and TextBoxs. In Page_load event I first check it is not postback then tried to run following codes if Ctrl is ListBox or DropDownList in foreach statement then I will do something. But two if statements never get true. What is wrong with my codes? Thanks!  foreach(Control Ctrl in this.Controls){       if (Ctrl is ListBox)      { ListBox lstBox = (ListBox)Ctrl; str = Ctrl.ID;       }      else i...

What is wrong with this user control code
I have a method behind a user control. The method simply display text in a label on the user control. Public Sub BuildPage() Dim strTest As String Try objMyData = New CreateDataForDisplay strTest = objMyData.DataGrab lblHTML.Text = strTest objMyData = Nothing Catch ex As Exception Throw New Exception("Error LeftNav Module: " & ex.Message, ex) End Try End Sub The methos it calls is: Public Class CreateDataForDisplay Public Function D...

How to control embded .net code in javascript?
There is a javascript function in aspx page and try to call a .NET code function:   function test(){              var yesno;     yesno = <%=CallYesno()%>;   } The .Net function is:Public Function Yesno() As BooleanEnd Function  When you load the page , it always executeYesno function even you never call test function. Why? How to solve this issue? Hi, the simple idea in a ASP.NET request/response is that server--side code runs before client-side code. E.g the server-side cod...

.net 2.0 login control code?
Ok, so the 2.0 has a login control amonst others. Anyone know if the source is available or will be available? I am trying to replicate what it does in 1.1 I need a good login control that I can customize. I am still a beginner in .net and learning fast....

What's wrong with this tab control code ?
 Hi I found this combination of FormView & Tab Control DID insert a new record but it is a blakn record that it dadded !! It works before I put in the tab structure. Could someone look at this code and show me where is wrong ? VS2008 keeps saying Script Manage is needed but I have it there as seen in the code. Pls help. Thanks function pageLoad() { } '>'>'>'>'>'> <%@ Page Language="VB" %> <%@ Register assembly="AjaxControlToolkit" namespace=&qu...

WRONG WRONG WRONG
Name: ROZ mandelcorn Email: thunderstaratearthlinkdotnet Product: Firefox Summary: WRONG WRONG WRONG Comments: as a long-time user, first of netscape and, mozilla firefox, i must say i DO NOT LIKE THE PLACEMENT of TABS in version 4. nor do i like the whole rearrangement of the upper/navigation portion of firefox. I NEED/WANT MY TABS DIRECTLY ABOVE MY WINDOWS AS IT IS NOW....NOT ON TOP OF THE BROWSER. I WANT MY FILE-EDIT-ETC-MENU on TOP. ETC. AT LEAST GIVE US THE CHOICE AS TO WHICH FORMAT WE WANT....CAN YOU SAY CUSTOMIZATION! I WILL NOT USE 4 IF THIS IS THE WAY IT IS. [just ...

What's wrong in my VB.NET code?
Dear all, I'm trying to write the code for a "login" button, to check if the username & password is correct or not and if it's correct check the type, because I have 3 types of users, and each case there should be an update but it's not updating, please check my code below and tell me what's wrong? why it's not updating in the database? I'm using ASP.NET 2003 and SQL 2000.Private Sub login_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login_btn.Click CheckAccess() End Sub  Private Sub CheckAccess() Dim type A...

Coding in a Repeater control in .NET 2.0
I have a repeater control listing records from a database.  For each record, I want to check the value of a field. Part of what gets printed will depend on the value of the field.  So far I have the following, which is working.  What I want is for th second line to say one thing if ReNewAd has a value, ans something else if it doesn't.  <asp:Label runat="server" ID="LabelFirstLine"> <p><a href='Template.aspx?i=<%# Eval("File2")%>'><%# Eval("Last Name")%>, <%# Eval("First Name")%> </a> - <%# Eval("City")%>, <%# Eval(...

programatically create html-code and .net controls
Hi i have a problem. I want to create a webform programatically and put a textbox inside a <td>-tag. This is how i tried to do but its not working: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Response.Write("<html><head>................................<td>") Dim txtBox as New TextBox txtBox.ID = "myBox" Me.Controls.Add(txtBox) Response.Write("</td>...................................</html">) End Sub Can someon...

Code generation in Microsoft.net ( code that writes code ) Whats its future
Hello, I was just reading a book about Code Generation in .NET. Its damn hard book to read. What do u think is the future of Code GenerationHighOnCodingWanna get high! It's being used now quite a bit. Not necessarily out the box click a button, and you get an application, but applications will generate specific code to function dynamically.Kay LeeMySpace.com - http://www.myspace.com/kragieInfrastructure GroupMySpace.com- Code to live, but Live to code. the refactoring tools already available (and those that are destined for the new IDE) use the same techniques. we will pr...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

Web resources about - What is wrong with code - asp.net.presentation-controls

Wrong - Wikipedia, the free encyclopedia
while civil law countries tend to have some additional categories, such as contraventions . Moral wrong is an underlying concept for legal wrong, ...

The Wrong Path? Facebook Cuts Off Access To Find Friends API From Social Network’s App
Social network Path became the latest application to lose access to Facebook’s find friends application-programming interface, prohibiting Path ...

To the National Review Online: This Wrong Needs to be Righted! - Facebook
Allen West hat eine Notiz mit dem Titel To the National Review Online: This Wrong Needs to be Righted! geschrieben. Du kannst den vollständigen ...

Why you may be learning the wrong reasons from Facebook marketing gurus
... ROI of over 1,200%. As had been noticed, even little engagement, social media can be used to directly generate sales. But don’t get me wrong, ...

Hong Wrong Blog (@hongwrongblog) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Scripting News: Silicon Valley is wrong about college.
Lately I've been thinking a lot about startup culture, and am reminded of its nobility having started three companies in my career, and learned ...

Scripting News: Why Charles Pierce is wrong about Ezra Klein being wrong.
... Pierce's attitude many times, from all kinds of ink-stained pros, some very accomplished. The arrogance is impressive, but they're still wrong. ...

Scripting News: I had to get a NYT Digital Subscription to figure out what's wrong.
Yesterday I posted a tweet with some feedback for the NY Times marketers. Getting a NYT Digital Subscription should open up something new and ...

Scripting News: Privacy is the sometimes wrong word.
You can talk about the security of your personal information in a different ways, each of which suggests a different set of issues. If I call ...

I Love You, David Byrne, But You're Wrong
David Byrne says he’s going to leave New York if the 1% succeeds in squeezing the creativity out of NYC. I have a different perspective. Maybe ...

Resources last updated: 12/1/2015 7:40:35 PM