Those of you who know me knows how much I don't get along with PowerShell.
When I will get some spare time I will write a "CSharpShell", which will basically allow me to use .NET syntax...
But in the meanwhile, I always find myself looking for that one line of STSADM command to enable developer dashboard in STSADM... so i thought i might post it here:
stsadm -o setproperty -pn developer-dashboard -pv on
or
stsadm -o setproperty -pn developer-dashboard -pv ondemand
enjoy...
A blog by the KWizCom SharePoint experts! The KWizCom team, led by its VP R&D Shai Petel, utilizes its experience and knowledge to give a unique insight on Microsoft's SharePoint platform - the leading business collaboration platform.
Friday, January 15, 2010
Encode in JS Decode in C# problem
Just a quick one guys,
Recently we had a customer who complained about French tags that are not working with our tagging feature (field type, tag cloud for SP 2007 - pretty cool actually).
Well, apperantly we were doing some encoding of text in javascript using "escape()" and trying to decode it in C# on the server side using UrlDecode with no luck.
the text: "de l'entité" was not decoding correctly.
After trying to figure our whats wrong on the server side decoding function (I tried several alternatives) I almost gave up with no success whatsoever :(
So, I turned to look for alternatives in the Javascript encoding and found this new method called "encodeURI()". Apperantly this method can safely replace our "escape/unescape" in Javascript only it supports proper encoding and decoding with C# with no problems.
Works like a charm - from now on, use "encodeURI/decodeURI"!
Cheers, Shai.
Recently we had a customer who complained about French tags that are not working with our tagging feature (field type, tag cloud for SP 2007 - pretty cool actually).
Well, apperantly we were doing some encoding of text in javascript using "escape()" and trying to decode it in C# on the server side using UrlDecode with no luck.
the text: "de l'entité" was not decoding correctly.
After trying to figure our whats wrong on the server side decoding function (I tried several alternatives) I almost gave up with no success whatsoever :(
So, I turned to look for alternatives in the Javascript encoding and found this new method called "encodeURI()". Apperantly this method can safely replace our "escape/unescape" in Javascript only it supports proper encoding and decoding with C# with no problems.
Works like a charm - from now on, use "encodeURI/decodeURI"!
Cheers, Shai.
Labels:
C#,
Client Code,
Code,
Developer,
JavaScript
Friday, December 4, 2009
Work with Rating Field data, anywhere.
Great new article by Sveta Yerpilev, SharePoint Consultant for KWizCom Professional Services. Take a look:
Work with Rating Field data, anywhere.
by Sveta Yerpilev
Rating fields allow you to gather user opinions about your data. But sometimes you can have a problem displaying this data. In this article we will talk about using the Rating Field in Data View Web Parts and Custom List Forms and how to circumvent problems that might arise..
First of all it is important to note that a Rating field contains only numbers and can’t contain images or any other type of data. This means that if we want to show rating in a Data View Web Part row we need to build the images manually. How is this done?
Let’s take a look at the Rating field in a standard list view using IE Developer Toolbar. As we can see the image source equals to: “_layouts/KWizCom_RatingSolution/Images/[number].gif”.
So we can open this folder – 12/Templates/Layouts/KWizCom_RatingSolution/Images - and find all “star” images that our rating solution uses.
This is where you can change or overwrite the default images of the Rating solution to suite them to your own design.
So how can we use this knowledge in the Data View Web Part? When you try to add a Rating field to the Data View Web Part you’ll see the following code:
where “Rating” is the name of your Rating field. This code will show you the rating as a number with the value of 1-5. To show an image instead of a number you need to replace the existing code with the following string:
This code will build the image source link according to the rating value of the item, so you will see the right image.
Well, now we can see images instead numbers. Great! But what if we need to rate from the Data View Web Part? How do we make our image clickable?
We need to use the IE Developer Toolbar one more time to discover the function that opens additional pop-up window with the ability to rate...
Here is the function:
We will then get the following code:
Now we have a clickable image that can be used to view a summary of previous user rating and so that you can rate. But what about the details? How can we show all the ratings and comments attributed to an item? We definitely need the “Details” link here.
Choose the link’s place in your DataView and add the following code after you changed the siteURL and ListID parameters:
Details
This code will add a link displayed as “Details” to your Data View Web Part. You can change the word “Details” to any other word or sentence.
That’s it. Now we can create Data View Web Parts and Custom list forms that know how to work with the rating field.
Here is a sample for Print View for one of the Articles list in SharePoint:
Work with Rating Field data, anywhere.
by Sveta Yerpilev
Rating fields allow you to gather user opinions about your data. But sometimes you can have a problem displaying this data. In this article we will talk about using the Rating Field in Data View Web Parts and Custom List Forms and how to circumvent problems that might arise..
First of all it is important to note that a Rating field contains only numbers and can’t contain images or any other type of data. This means that if we want to show rating in a Data View Web Part row we need to build the images manually. How is this done?
Let’s take a look at the Rating field in a standard list view using IE Developer Toolbar. As we can see the image source equals to: “_layouts/KWizCom_RatingSolution/Images/[number].gif”.
So we can open this folder – 12/Templates/Layouts/KWizCom_RatingSolution/Images - and find all “star” images that our rating solution uses.
This is where you can change or overwrite the default images of the Rating solution to suite them to your own design.
So how can we use this knowledge in the Data View Web Part? When you try to add a Rating field to the Data View Web Part you’ll see the following code:
<img
src="http://www.blogger.com/_layouts/KWizCom_RatingSolution/Images/{@Rating}.gif"
/>
This code will build the image source link according to the rating value of the item, so you will see the right image.
Well, now we can see images instead numbers. Great! But what if we need to rate from the Data View Web Part? How do we make our image clickable?
We need to use the IE Developer Toolbar one more time to discover the function that opens additional pop-up window with the ability to rate...
Here is the function:
commonShowModalDialog('http://siteURL/_layouts/KWizCom_RatingSolution/RatingPopup.aspx?itemId={@ID}&listId=ListID','dialogHeight:450px;dialogWidth:350px;scroll:no;toolbar:no;status:no;resizable:no;',This is a long function that must contain the item and the list ID. But if we can get the item ID from the data source, we can just use the List ID as it is because most of the time we only use one static list in our Data View Web Part. So just replace the “ListID” with your List ID, siteURL with your site URL and enter this function as an ”onclick” event function in our rating image.
null, this.parentNode);
We will then get the following code:
<img
onclick="commonShowModalDialog('http://siteURL/_layouts/KWizCom_RatingSolution/RatingPopup.aspx?itemId={@ID}&listId=ListID'
,'dialogHeight:450px;dialogWidth:350px;scroll:no;toolbar:no;status:no;resizable:no;',
null, this.parentNode);"
src="http://www.blogger.com/_layouts/KWizCom_RatingSolution/Images/%7B@Rating%7D.gif"
/>
Now we have a clickable image that can be used to view a summary of previous user rating and so that you can rate. But what about the details? How can we show all the ratings and comments attributed to an item? We definitely need the “Details” link here.
Choose the link’s place in your DataView and add the following code after you changed the siteURL and ListID parameters:
Details
This code will add a link displayed as “Details” to your Data View Web Part. You can change the word “Details” to any other word or sentence.
That’s it. Now we can create Data View Web Parts and Custom list forms that know how to work with the rating field.
Here is a sample for Print View for one of the Articles list in SharePoint:
Subscribe to:
Posts (Atom)
