black hawk
New Member
I use ObjectDataSource as below.\[code\]<asp:ObjectDataSource ID="Item" runat="server" SelectMethod="Grid_DataBind" TypeName="XXX.XXX.XXX" DataObjectTypeName="Controller.Items" UpdateMethod="UpdateRow_Grid" InsertMethod="InsertRow_Grid">\[/code\]When InsertMethod fire, everything work fine but ...\[code\]public IList<Items> InsertRow_Grid(Items item) { item.ID = System.Guid.NewGuid().ToString(); bool contains = GridSource.AsEnumerable() .Any(row => item.JobID == row.JobID); if (!contains) { GridSource.Add(item); } else { lblMsg.Text= "This record has already exists."; } return GridSource; }\[/code\]It doesn't know my label object which is presented in my aspx file.
I had read this so that I can search proper solution.But I still don't get how to do.Every suggestion will be appreciated.