Arun Stephens

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: «/span>asp:GridViewID=“grdMessages”runat=“server”… >… «/span>ItemTemplate>«/span>uc1:EmailAddressID=“EmailAddress1”runat=“server”DataSource='<%# (MailAddress)Eval(“FromAddress”) %>'/></ItemTemplate>… </asp:GridView>But the DataSource property of the EmailAddress user control is never set. If I have a plain <%# Eval(“FromAddress”) %> right next to the <uc1:EmailAddress /> tag, the literal evaluates properly. Read more →

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: classDatabaseSource { long_messageCount = 0; publicListGetMessages(longstartRow, intpageSize) { Database db = newDatabase(); Listmessages = db.GetMessages( startRow, pageSize, out_messageCount); returnmessages; } publiclongGetMessageCount() { return_messageCount; } } Read more →