Posts

Showing posts from 2013

An error occurred while processing this request

Image
I recently started to develop a web form with knockout JS. The system is running on SharePoint 2010. The data given / taken  to  the form with JSON through WCF services. I had a problem, I did not want that the service will be expose to web. To prevent exposure, created casing in the SharePoint an Application Page. The WCF data services and any entity framework written in framework 4.5, and as you know that SharePoint 2010 and with the Application Page written in 3.5. This means that every reference to in the form of entity framework like linq or lambda expressions written in framework 3.5 - which created (and still creates) a lot of problems. I will present you one example of the problem we encounter - but Google unfortunately did not help. The following code in FW3.5 not working in Client Data Service if (ctx != null && ctx.UsersContext != null ) {      string username = "username" ;      v...

How to open a PDF file (or any file) in the sharepoint site

Image
Not long ago, I had to view a PDF file from sharepoint . But I got the following message: Do you want to save file-name from yours-site Who does not know this message? But I've  target ' self ' in 'a' tag html???? It turns out that SharePoint having your code to protect customers. They can only give you their familiar software like Office, but a pdf file - Microsoft unfamiliar terms. To resolve, you need to make a change in Central-Admin Go to your Web Application manage - General Setting Find Browser File Handling and Change the default to Strict . It all friends, now you can view any file on the portal (at your own risk). Your, Roi

Service Pack 2‏ (SP2) for Microsoft SharePoint 2010 and Office 2010

Last month came new version (Service Pack 2) for Office 2010, SharePoint 2010,  Project server 2010 and the Fast 2010. Here are some links that will help you Service Pack 2 for Microsoft Office 2010 (KB2687455) 32-Bit Edition http://www.microsoft.com/en-us/download/details.aspx?id=39667 Service Pack 2 for Microsoft Office 2010 (KB2687455) 64-Bit Edition http://www.microsoft.com/en-us/download/details.aspx?id=39647 Note: In addition to the products in the Office 2010 suite, service pack 2687455 also updates Microsoft Project 2010, Microsoft Visio 2010, and Microsoft SharePoint Designer 2010 Service Pack 2‏ (SP2) for Microsoft SharePoint Server 2010 (KB2687453) http://www.microsoft.com/he-il/download/details.aspx?id=39672 Service Pack 2‏ (SP2) for Microsoft SharePoint Foundation 2010 Language Pack (KB2687466) http://www.microsoft.com/he-il/download/details.aspx?id=39674 Service Pack 2‏ (SP2) for Microsoft FAST Search Server 2010 for SharePoint (KB2687446) http://...

Which w3wp process belongs to which App Pool

Image
Often you wonder which process belongs to which site (in my case usually SharePoint site)? Or maybe you just want to debug only your website on the development server . For this we have the appcmd. all you need is to run this command: %windir%\system32\inetsrv\appcmd.exe list wp Now you can see who is gobbling sites memory from is id (pid) Yours, Roi

Speedup Powershell at SharePoint 2013

Image
If you worked in stsadm in MOSS 2007 and even if it worked in SharePoint 2010 , you saw it slow. In 2010 we also added the powershell - who was sometimes slow. It turns out that in sharepoint 2013 not made significant changes - is suggested The solutions are Add crl.microsoft.com to your hosts file and point it to your local machine Go to Start -> Run Click "Drivers" (It need to open " C:\Windows\System32\drivers " - in not go to it) Go to folder " etc " and open " hosts " file with notepad and add this line 127.0.0.1       crl.microsoft.com Disclosure: this solution find a lot on Google - but my no significant change Disable the CRL check by modifying the registry for all user accounts that use STSADM and all service accounts used by SharePoint. Go to Start -> regedit and fund this location [HKEY_USERS\<userid>\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing] Yon need to change all y...

Message presented you leave your site

Image
This time,I present in JavaScript (Jquery) code that checks whether you leave your domain. If so - popup alert to informing you that you are leaving the domain $(document).ready( function () {     $( "a" ).click( function ( event ) {         // check if the target link is your.domain.com         // if not will show alert message         if ( this .href.indexOf( "your.domian.com" ) == -1) {             if ( this .href.startsWith( "http" )) {                 event .preventDefault();                 var linkLocation = this .href;                 alert( ' Note that you are ...

How to set as Secure Store Service in SharePoint 2010

Image
This time I'll introduce how to install   SSS (Secure Store Service) in SharePoint 2010 in 9 Easy Steps (tutorial) 1. Go to Central Admin -> Application Management On Service Applications link   Manage services on server 2. Start  Secure Store Service 3. Now, Click Applications Management then Manage Service Applications 4. Click New and then  Secure Store Service 5. Write Your Data 6. Click OK and you get this screen 7. On  Manage Service Applications you can see your service 8. Now you can create a new key - click Generate New Key 9. Write your key It all my friends, Roi

Value does not fall within the expected range

Image
Time introduced some strange problem. I needed to build a list with a lookup field. So build fields.. Then create content type.. and than a list detention.... Just.. Piece of cake. As you know, Lookup field problem must be linked to an existing list. So checking founder of the source list and then create the field. Something that looks like the following code plus or minus < Field Type ="LookupMulti" DisplayName ="Your List" Required ="FALSE" EnforceUniqueValues ="FALSE" Direction ="None" List ="Lists/YourList"      ShowField ="Title" Mult ="TRUE" Sortable ="FALSE" UnlimitedLengthInDocumentLibrary ="FALSE" Group ="YourGroup" ID ="{448f00a7-6cb5-4340-985f-990dd354f135}" SourceID ="{1ce2cabb-bea1-4137-aee8-b4f12b17abcc}"      StaticName ="YourName" Name ="YourName" Version ="3" /> The ...

side by side div with dynamic width

Image
Often we need to build two divs standing side by side, with their width variable (dynamic) The following code - will help you do it < div id ="container" >      < div id ="left" > Div 1 - What is my size </ div >      < div id ="right" > Div 2 -I am the < br /> Right DIV </ div >   </ div > < style type ="text/css" >   #left {   background: #aaa;   float: left } #right {   background: cyan;   overflow: hidden }   #container {   width :400px; }   </ style > Yours, Roi

Support the HTML5 placeholder Attribute in Browsers that do not support it

Image
HTML5 language gives us the possibility of a Placeholder. The placeholder Attribute gives us information on the textbox where we are supposed to use. All you need is to add the same type of input tag. <input type="text" name="first_name" placeholder="First name"> Browsers that do not support it will show like: Browsers that support it will show like: If you want the older browsers will support it, all you have to do is add the following JQuery code: /* Input Tag Placeholder Support*/ function IsInputPlaceholderSupport() {     var i = document.createElement( 'input' );     return 'placeholder' in i; } $(document).ready( function () {     if (!IsInputPlaceholderSupport()) {         var fields = $( 'input' );         for ( var i = 0; i < fields.length; i++) {        ...

Preventing copy-paste all the rich text editor in SharePoint

Image
As part of an accessible Web sites in SharePoint, this time I will present the code prevents the copy-paste. The following code prevents copy-paste content editor rich text field /*  ECM  */ function disablePasteForRTE() {     Type.registerNamespace( "RTE" );     if (RTE) {         if (RTE.RichTextEditor != null ) {             RTE.RichTextEditor.paste = function () {                 RTE.Cursor.paste( true );             }             RTE.Cursor.$3C_0 = true ;         }     } } if (_spBodyOnLoadFunctionNames != null ) {     _spBodyOnLoadFunctionNames.push( 'disablePasteForRTE'...

Construction of correct design patterns in SharePoint

Image
As in the previous post, to avoid content editor put the wrong color and not merit. You need to built styles for content editor How do I add style? Add the following CSS code to the Master-Page h1.ms-rteElement-YourTitle {     -ms-name : " Your Title " ;     font-family : arial ;     font-weight : bold ;     font-size : 14.5pt ;     color : #9bbe08 ;     height : 33px ;     line-height : 33px ; } Thanks, Roi

Prevention design is not good for Accessibility in SharePoint

Image
Often, the editors of the content of Web sites write the content and design they give does not match the colors of the site and do not match the colors of accessibility. To prevent them from putting bright pink, or to establish rules, remove the redundant design. Before After Put the following CSS code in your Master Page (preferably course file) #Ribbon\.EditingTools\.CPEditTab\.Font {     display : none ; } #Ribbon\.EditingTools\.CPEditTab\.Paragraph-Large-0-0-0 , #Ribbon\.EditingTools\.CPEditTab\.Paragraph-Large-0-0-1 {     display : none ; } Yours, Roi

Website Accessibility in SharePoint

Image
As part of my work I had to build accessible Web sites This article explains what is accessible and why we need it. The following articles explain how accessibility can be applied in practice in SharePoint What is Website Accessibility? Accessibility is defined as a need to increase the use of people with disabilities (blind, color blind, deaf, have problems with motor or cognitive) sites and computer systems. Accessible websites are websites that allow people with disabilities and older people to browse at the same level of efficiency and fun as surfing the Internet. Accessible Web Development is not just a matter of social responsibility and compliance with laws and regulations. December 2008 announced a new version with accessibility guidelines ( version 2.0 ) - This version is the binding version. Differences of the three access levels: • Priority 1 - A basic level of accessibility • Priority 2 - AA basic level of accessibility • Priority 3 - highly accessible AA...

Free Disk Space on SQL Server

Image
We often are needed to develop command and control systems. What happens if we need to develop a system that tell us about disk space SQL server Here is the code Select @@servername as 'SQL Server Name' , getdate() as Date     EXEC master..xp_fixeddrives Yours, Roi