Posts

Showing posts with the label Share Point Web Controls

Sharepoint Workflows / ASP.NET - Logging using diagnostic traceing

One of the coolest feature in asp.net is its tracing. Good thing is that it can be utilized in sharepoint as well and provide an easy way for logging inside workflow foundation. You just need to add following in you sharepoint web.config file <system.diagnostics> <switches> <add name="System.Workflow LogToTraceListeners" value="1" /> <add name="System.Workflow.Runtime.Hosting" value="Verbose" /> <add name="System.Workflow.Runtime" value="Verbose" /> <add name="System.Workflow.Runtime.Tracking" value="Verbose" /> <add name="System.Workflow.Activities" value="Verbose" /> <add name="System.Workflow.Activities.Rules" value="Verbose" /> <add name="[Your namespace]" value="Verbose" /> </switches> <trace autoflush="true" indentsize="4"> <listeners> <add name=...

Sharepoint Web Control - Validating date time control (SPDateTimeControl with validators)

When working with Sharepoint Controls you may experience different behavior sometime as anticipated with any other controls library. I was thinking of doing some date validation and found some interesting fact with SPDateTime Control. Few were not relevant to me so I didnt looked up them but I need to put required field validator for my mandatory field. I noticed that required field validator included in libaray was not working. After looking at member properties I found that there are properties included in controls for handling this 1. IsRequiredField 2. ErrorMessage I used above fields and it worked for me nicely. The second task was to control invlaid dates entry from user. I thought it would be built in in the control and my guess was right with some exception. Sharepoint was handling this but for some reason it was not controlled at client side. I checked SPDateTimeControl.IsValid at server side and it worked for me. Though it was working on server side I decided to stop false e...

Using sharepoint webcontrols for desinging forms

I prefer using share point web controls for designing share point custom aspx form as they provide extended properties and also provide look n feel similar to out of box look n feel. Following is an useful msdn link for getting help related to controls http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.aspx They are easy to brand with overall theme and master pages. following are list of few important controls Text Box -- SharePoint:InputFormTextBox Drop down -- SharePoint:DVDropDownList People Editor -- SharePoint:PeopleEditor Date Time -- SharePoint:DateTimeControl ( for details on validation) Labels -- Sharepoint:EncodedLiteral Also there are few important webcontrol that can be utilized for creating sections and aligning controls /_controltemplates/InputFormSection.ascx for Defining section /_controltemplates/InputFormControl.ascx for defining control following is a sample ascx for above ---------------------------------------------------------------------- ...