kamagra how much to take

Remember To Encode SharePoint Link* Fields Correctly

When using a SPGridView control or a similar interface control representing fields out of a SharePoint list, it is important to remember that the SharePoint Link* fields are encoded correctly. Most other types when using something like SPListItem.GetFormattedValue will be fine, but when LinkTitle, LinkDiscussionTitle, etc. are hit you can use something like the below to HTML encode it.

  1. string.Format("<a href=\"{0}/{1}?ID={2}\">{3}</a>", SPListItem.Web.Url, SPListItem.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url, SPListItem.ID, SPListItem.GetFormattedValue(SPField.InternalName));

To test the type just use , then employ an equality test:

  1. if (Equals(SPListItem.GetFormattedValue(SPField.InternalName), "LinkTitle"))
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>