Monday, May 19, 2008

AJAX.Net

In the past I have talked about some of the frameworks being used on the current website I am working on uses. I have mostly talked about NHibernate. Well this post will be different since I am going to talk about a UI Framework called AJAX.Net and the AJAX Tool Kit. These frameworks come from Microsoft.

On our website we use the UpdatePanel quite a bit. It provides a simple async call back mechanism so we only have to post back parts of pages. This comes in handy when u want to update a part of a web page with new information or data without having to interrupt the user from reading or investigation other parts of the web page. The control is very easy to use and can really save developers lots of times in implementing this type of functionality.

I could talk all day about the update panel, but I want to really talk about a control found in the AJAX toolkit called ModalPopupExtender. We use the ModalPopupExtender control on our project to notify the customer that then still have work to do in filling out their data. Since user input is gathered in multiple steps it guides the user to what they need to do next. Of course we give the user the option to close out of it and move forward on their own. We added data checking so that the modal pop ups only display when needed.



As you can see the background get grayed out and you can style the pop up to look like the rest of your website. You can put any HTML, ASP.NET control, or other control in the modal.

If you haven't already checked out the AJAX.NET or AJAX toolkit from microsoft, you can fin them here.

Thursday, May 15, 2008

NHibernate Odds and Ends

I have blogged about NHibernate in the past, and am going to talk about some odds and ends I have learned while using the tool on my current project.

First for the most part I love working with Nhibernate. Every time I have needed to add data access support it has been super simple to add. Everything is based off your Object Model so getting the data needed is a snap. Just open a session create a criteria, return your data, and close the session.

NHibernate logging works very well as well. it was easy to go in the log files and see what the tool really is doing. The one think to note is it can be very verbose and really slow down your application the more you log. For Production I would recommend ERROR only, otherwise you might find you app writing 100's of MB per page request.

One area I found a problem was in Like Querying. I was able to get Like working for smaller varchar columns Like city. An example would be Expression.Like(property, keyword, MatchMode.Anywhere). The problem I ran into for larger fields like say a comments field, it would not work. It could not match the keyword charming in a large varchar field even if charming was the only word. it was rather odd behavior and I was forced to write the SQL by hand and use the ISQLQuery created off the NHibernate session.

Just a side note, we are also using spring.net with our application and that is handling a lot of our configuration.

Again I cant talk about how much I enjoy working for the most part with NHibernate. It really does save development time when building applications.