Thursday, January 23, 2014

Pass DateTime in WCF XML Request



To pass datetime valu in wcf XML Request we need to change date in YYYY-MM-DDThh:mm:ss format.


Example : DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ss.fffffffZ")

http://stackoverflow.com/questions/254753/what-is-the-correct-format-to-use-for-date-time-in-an-xml-file
http://www.w3schools.com/schema/schema_dtypes_date.asp

Tuesday, January 21, 2014

Enable MVC Add View to Orchard Project


1. Select the Porject you want to enable mvc
2. Right Click and Select Unload Project
3. Right Click Unloaded Project file and click Edit Project File
4. Search for  ProjectTypeGuids and add following guid to enable mvc projects
 {E53F8FEA-EAE0-44A6-8774-FFD645390401};


{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

http://ericphan.net/blog/2011/1/22/tip-enable-mvc-3-add-view-to-orchard-code-generated-module-p.html

Monday, January 20, 2014

Orchard Commands to generate code

To open Orchard command line tool
Go to Orchard.Web > bin > Run Orchard.exe

1. Theme scaffolding

     - codegen theme SampleSite /CreateProject:true
      - codegen theme MyFirstTheme

SampleISite : New Theme project
use second command if you want to generate theme in existing Theme project of orchard source code

Orchard - Command line scaffolding


Code generation is an Orchard module that automates the task of creating additional files and extensions. This feature is useful for developers that want to create controllers, data migration classes, modules, and themes. However, the code generation feature is not installed by default when you install Orchard.

Enable it via command line


feature enable Orchard.CodeGeneration


http://docs.orchardproject.net/Documentation/Command-line-scaffolding


Pop up to ask user before leaving a page if there are unsaved chnages.

Here is the good article to implement this functionality but i was unable to do this with post back buttons in share point web part, it broke all subsequent post backs on page if user clicks "Stay on page", for Hypelinks it works perfectly. I used javascript confirm for postback buttons.

http://snippets.surfthru.com/post/Check-For-Unsaved-Changes-Before-Leaving-a-Page.aspx