Sunday, February 12, 2012

State Pattern

I am learning about design patterns in depth these days. Amazed by the solutions they give .. Some patterns like abstract factory , factory made sense to me but could not find immediate application to my code .. so could not get that uahaa feeling ;) When i read about the state pattern http://blog.raffaeu.com/archive/2011/02/13/state-pattern-using-c-part-01.aspx .. i found an immediate use for this in all my code. I realized how my code is tightly coupled all these days .. Implemented this and now i have a happy feeling .. I learned something new and implemented it . .................. :) :)

I have a class which as states such as new edit view .. I moved all the logic related to this states using this pattern :)

Friday, February 3, 2012

Hidden Field in a disabled panel or div

I was working on a form for a project. The form needs to be edited or viewed. For view i disabled all the panels or divs.But it has some links which needs to work. The links used hidden fields inside the disable panel.
Then i sudden found the links are not working as the hidden fields are not retaining the values as they normally do. Then a google search on this gave me this link .. which saved my time a lot.. It seems asp.net does not maintain view state for hidden fields in a disabled panel. So need to get around this by some way :)

http://www.codewrecks.com/blog/index.php/2010/04/15/asp-net-and-an-hiddenfield-inside-a-disable-panel/