Friday, November 05, 2010

MarkLogic, Restful Service, etc

This post is used to summarize all resource for marklogic database, REST web serivces and other related technologies needed for my new job.

Monday, October 25, 2010

DataList and ViewState

It could be either intended or an issue of ASP.NET, but the bottom line is the ViewState is not available for DataList control! Therefore, page after posting back will find datalist lost its viewstate. The solution is:
  1. save controls' status into session. (controls here is the controls inside datalist control)
  2. using OnItemDataBound(...) function to reload status info from session

Tuesday, August 17, 2010

execute dynamic query from stored procedure

After realized the crazy requirements of the site locator program, I know a common store procedure won't work. However, because of our database name is different in each enviorment (staging, QA, prod), the dynamic query in the code won't work either. The only solution is to use sp to run dynamic query. the sql syntax looks like this:

EXECUTE SP_EXECUTESQL @sqlStatement

where @sqlstatement is nvarchar (max 4000 charaters). The caveat here is 4000 is really short, and a long/complex query will easily exceed this limit.

Friday, February 26, 2010

MVC study and thoughts

First of all, I think MVC is a big deal. It separate concerns of data layer, business layer and presentation layer. If used well, it will generate much cleaner and maintainable code than regular web form. However, I found MVC falls short in the following areas:
  • report. it always seems to be true: a report should just stay simple instead of trying any other advanced approaches such as TDD or MVC. In the end, it's just report which represents data directly from the data layer, and most likely with lots of fancy staff on the UI
  • dynamic HTML (with input). if you don't know how many controls you page will have to generate, and also you are expecting inputs from these controls, it's challenging using MVC.
  • JQuery in custom while using AJAX, this seems like not a big issue and not directly related to MVC, but since MVC use AJAX and Jquery a lot, so just be aware