| | |
e.Item.DataItem=null in Repeater ItemCommand
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
Hi.....
I am binding a Repeater control with List<int> at OnLoad event
it works fine.....my Repeater bind successfully......i have a button at each Repeater Item....When i click on that button my Repeater Item Command is fire ......but my code e.Item.DataItem is null
I am binding a Repeater control with List<int> at OnLoad event
ASP.NET Syntax (Toggle Plain Text)
protected override void OnLoad(EventArgs e) { if(!Page.IsPostBack) { List<int> datasource =Get(); if(datasource!=null) { rpt.DataSource=datasource; rpt.DataBind(); } } base.OnLoad(e); }
protected void rpt_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
if (e.CommandName == "Remove")
{
int i=(int)e.Item.DataItem // This Line shows error (my ItemDataBound event is working fine.....)
}
}
} Last edited by peter_budo; Dec 21st, 2008 at 4:59 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Web Application unavailable on remote machine
- Next Thread: Referencing Detailsview template field
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis javascript list listbox menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





