[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

ASP.NET MOBILE - I wander. Type, already contains a definition for

LADEF - BRAZIL

7/22/2008 7:56:00 PM

I am creating a project asp.mobile net based on VS2003, but in VS2005, only
that that mistake happens in the line 16 of the code

Error 1 Type 'DataboundListExample' it already contains a definition for
'List1'
c:\inetpub\wwwroot\VS2005\NET2.0\AspNetMobile\Capitulo10\DataboundListExample.aspx.cs 16 20 http://localhost/VS2005/NET2.0/AspNetMobile/Capitulo10/

Below sending the whole code of the somebody is paginated can help myself at
once I thank

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class DataboundListExample :
System.Web.UI.MobileControls.MobilePage
{
protected List List1;//Line Error

override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.List1.ItemCommand +=
new ListCommandEventHandler(this.List1_OnItemCommand);
}




protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList array = new ArrayList();
array.Add(new TeamStats("Dunes", 1, 38, 24, 8, 6, 80));
array.Add(new TeamStats("Phoenix", 2, 38, 20, 10, 8, 70));
array.Add(new TeamStats("Eagles", 3, 38, 20, 9, 9, 69));
array.Add(new TeamStats("Zodiac", 4, 38, 20, 8, 10, 68));

List1.DataSource = array;
List1.DataTextField = "TeamName";
List1.DataValueField = "Points";
List1.DataBind();
}

}
private void List1_OnItemCommand(
Object source, ListCommandEventArgs args)
{
// Display the Stats page.
this.ActiveForm = Form2;
Label1.Text = args.ListItem.Text + ": " + args.ListItem.Value;
}

}

Regards. Luiz - Translated Brazil of the Portuguese for English for Babylon