One thing that has become very important in my recent work is datalayers. I’ve seen a few difference approaches to filling objects after the data has been retrieved. All methods appear very similar in theory, but the implementations and restrictions are slightly different.
I’ll start with the simplest example which is right here is “Single User Blog”. I like the theory behind this, basically there is a root object in the application that all other objects inherit from, in this case “ApplicationDataObject”. This root object contains a Fill() function which can in simplest terms, populate itself from an input datasource....
From what I've seen this particular error is already pretty well documented, however it is one of the things that Visual Studio is a little misleading about.
Seems this is a lesson why you can't always rely on intellisense to tell you what to type. In a datagrid, the following code will error:
Error:
<EDITITEMTEMPLATE>
<asp:TextBox id=TextBox1 runat="server">
<%# TimeZoneInformation.ToLocalShortDateString( (DateTime)DataBinder.Eval(Container.DataItem, "FromDate")) %></asp:TextBox>
</EDITITEMTEMPLATE>
This will land you with a "'TextBox' cannot have children of type 'DataBoundLiteralControl'." error.
Solution.<EDITITEMTEMPLATE><asp:TextBox id="TextBox1" runat="server" value='<%# TimeZoneInformation.ToLocalShortDateString(
(DateTime)DataBinder.Eval(Container.DataItem, "FromDate")) %>'>
</asp:TextBox>
</EditItemTemplate>In this case the "value" tag is valid, even though intellisense doesn't think...
Just an observation, and of course I'm not expecting any miracles in this department. But from the 15 days I've had this new site running the msn.com search has indexed 74 pages (basically the entire site) and google.com is currently sitting on 3. I must admit I had my hopes pinned on google to be the first to index everything. I even went to the trouble of providing google with a sitemap. Oh well…I guess in terms of speed of inclusion into a search engine, we have a winner…
Here is the new Sqlite Dataprovider for SingleUserBlog v2.0.1. It is now supports string IDs so any existing SingleUserBlog can migrate easily.
Find out more information at its new home here.
Please feel free to leave any comments, feedback or problems on this post.
The proof of concept IHTTPModule friendly url rewriter for SUB using regular expressions.
For my previous post regarding friendly urls see here.Edit: To read more on this topic see my next post here.
There are very important differences between IHttpHandler and IHttpModule.
Last week I was also playing around with IHTTPHandler as a way of implementing a stop-gap friendly url handler.
Now the important difference is, once the request is sent to IHTTPHandler, if it doesn’t send any content back, the user will basically see a blank page. Now that’s not to say that one handler can’t pass the request only another handler...
Please be aware that it may still have bugs. I have been using it now for about two weeks, making small refinements as I’ve found them.
To Install. Copy the “sub.db” file in the /Data directory.
Ensure the “sub.db” file is writable and not read-only.
Copy the "kowitz.SQLiteBlogDataProvider.dll" file into the /Bin directory.
Copy the "System.Data.SQLite.dll" file to the /Bin directory.
Change the config file so SUB now uses the SQLite provider: <DataAccessType> kowitz.SingleUserBlog.Services.DataReaderBlogDataProvider, kowitz.SQLiteBlogDataProvider </DataAccessType> If you experience any problems when using the provider, just post comments here. Download Get it here [Edit 10-Mar-06: Updated Link]View Source Files OnlineI've...
Probably the best thing about SUB is its simplicity. There are two things I’d like to try to document in this post, firstly is the code for adding a simple google sitemap, the other is actually a question. I’m still curios to why Darren has used hard coded URL formatting in most of the repeaters when displaying a collection of posts. Under the APP_Code/ directory there is a UrlFormatter class which can generate a URL for any ApplicationDataObject (post or feedback item).
Taking this UrlFormatter class into consideration I have modifiied the GSiteMap.ashx file include a method that will write...