Declarative data binding on User Controls

I had this problem a few years ago and figured that there was no good solution, but I am older and wiser now so figured it’s time look for a better solution. I have a GridView, and inside the ItemTemplate I call one of my own UserControls: <asp:GridViewID="grdMessages"runat="server" ... > ... <ItemTemplate><uc1:EmailAddressID="EmailAddress1"runat="server" DataSource='<%# (MailAddress)Eval("FromAddress" Read post »

ObjectDataSource.SelectCountMethod wants an int

I have been working with the GridView ASP.NET control today, bound to an ObjectDataSource. This is to do with my experiment with DBMail that I mentioned the other day. It wasn’t working. I couldn’t find a solution on the net. By chance, I changed this: class DatabaseSource { long _messageCount = 0; public List GetMessages(long startRow, int pageSize) { Database db = new Database(); List messages = db.GetMessages( startRow, pageSize, out _messageCount); return messages; } publiclong GetMessageCount() { return _messageCount; } } into this: Read post »