Thursday, January 5, 2012

Client object Model Using Silverlight in SharePoint (Getting Records From SharePoint List)



ClientContext context = new ClientContext(ApplicationContext.Current.Url);  
  context.Load(context.Web);
  List Projects = context.Web.Lists.GetByTitle("Opportunity Financial Data");
  context.Load(Projects);           
  CamlQuery query = new Microsoft.SharePoint.Client.CamlQuery();
  string startDateFx = FirstDate.ToString("yyyy-MM-dd");
  string endDatFx = LastDate.ToString("yyyy-MM-dd");
  camlQueryXml = "<View><Query><Where><And><Geq><FieldRef Name='Created' /><Value IncludeTimeValue='FALSE' Type='DateTime'>" + startDateFx + "</Value></Geq><Leq><FieldRef Name='Created' /><Value IncludeTimeValue='FALSE' Type='DateTime'>" + endDatFx + "</Value></Leq></And></Where></Query></View>";
  query.ViewXml = camlQueryXml;
  _financialData = Projects.GetItems(query);
  context.Load(_financialData);

 context.ExecuteQueryAsync(new ClientRequestSucceededEventHandler(OnRequestSucceeded), null);


///

private void OnRequestSucceeded(Object sender, ClientRequestSucceededEventArgs args)
 {        
     Dispatcher.BeginInvoke(BindData);
 }
//The BindData method will refer the Items which are going to bind to GridView
//Note : To bind the data to gridview use the "_financialData" collection

Tuesday, January 3, 2012

Manage blocked file types (SharePoint Server 2010)


Add or remove blocked file types
Use this procedure when you want to prohibit files of a specific type from being saved or retrieved from any Web application on a server.
To add or remove blocked file types by using Central Administration
  1. Verify that you have the following administrative credentials.(You must be a farm administrator on the server.)
  2. In Central Administration, click Security.
  3. On the Security page, in the General Security section, click Define blocked file types.
  4. On the Blocked File Types page, if you want to change the selected Web application, on the            Web Application menu, click Change Web Application. Use the Select Web Application page to select a Web application.
  5.  Do one of the following:
  • To block an additional file type, scroll to the bottom of the Type each file extension on a separate line text box, type the file extension you want to block, and then click OK.
Note:
You do not have to type a file extension in the list in alphabetical order. The next time you open the list, the file extension you added will be correctly sorted in alphabetical order.

· To stop blocking a file type, select a file type from the list, press the Delete key, and then click OK.