tag:blogger.com,1999:blog-13846984256253652552024-03-05T22:44:31.021-08:00SharePoint BlogSharePoint, C#, JavaScript, XML and OthersDinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.comBlogger45125tag:blogger.com,1999:blog-1384698425625365255.post-73853998435807970032013-08-17T11:40:00.000-07:002013-08-19T08:29:55.263-07:00Update User Profile picture programmatically in SharePoint<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>User Profile Service application</strong></span> maintains all the Information about the User
available in SharePoint as User Profiles. These Information will be synchronized with the
external source such as Active Directory or Custom DB by User Profile
Synchronization Service running in the SharePoint server. User Profile Photo is
one of the property in User Profile called “<strong><span style="color: #cc0000;">PictureUrl</span></strong>”. All the User Profile
Photos are maintained in SharePoint library in <strong><span style="color: #cc0000;">My Site</span></strong> called “<span style="color: #cc0000;"><strong>User Photos</strong></span>”, for
each User Profile 3 files are maintained with various dimensions (Large,Medium
and Small size) in the library.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">When a User uploads a profile picture in SharePoint, these
three files will be created from the chosen file and uploaded to the <span style="color: #cc0000;"><strong>Profile
Pictures</strong></span> folder in “<span style="color: #cc0000;"><strong>User Photos</strong></span>” library under My site and the reference to the
Image will be updated to the “<span style="color: #cc0000;"><strong>PictureUrl</strong></span>” property in the User Profile.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">If we are giving an option to change the Profile picture in
out custom component, we also need to create these 3 different files and update
the reference in User Profile property. Below code snippet will do the need.</span></div>
<pre class="brush:csharp">#region Profile Image Updation
/// <summary>
/// Updates the current User profile Image
/// </summary>
/// <param name="sender" />
/// <param name="e" />
protected void btnProfileUpload_Click(object sender, EventArgs e)
{
try
{
//Uncomment if Change profile photo functionality is required
if (Page.IsValid && ctrlUpload.HasFile)
{
UploadPhoto(SPContext.Current.Web.CurrentUser.LoginName, ctrlUpload.FileBytes);
}
}
catch (Exception ex)
{
ErrorHandling.WriteLog("btnProfileUpload_Click " + ex.Message, ex, SPContext.Current.Web);
}
}
public void UploadPhoto(string accountName, byte[] image)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(webURL))
{
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
ProfileImagePicker profileImagePicker = new ProfileImagePicker();
InitializeProfileImagePicker(profileImagePicker, web);
SPFolder subfolderForPictures = GetSubfolderForPictures(profileImagePicker);
string fileNameWithoutExtension = GetFileNameFromAccountName(accountName);
int largeThumbnailSize = 120; int mediumThumbnailSize = 90; int smallThumbnailSize = 30;
using (MemoryStream stream = new MemoryStream(image))
{
using (Bitmap bitmap = new Bitmap(stream, true))
{
CreateThumbnail(bitmap, largeThumbnailSize, largeThumbnailSize, subfolderForPictures, fileNameWithoutExtension + "_LThumb.jpg");
CreateThumbnail(bitmap, mediumThumbnailSize, mediumThumbnailSize, subfolderForPictures, fileNameWithoutExtension + "_MThumb.jpg");
CreateThumbnail(bitmap, smallThumbnailSize, smallThumbnailSize, subfolderForPictures, fileNameWithoutExtension + "_SThumb.jpg");
}
}
SetPictureUrl(accountName, subfolderForPictures, fileNameWithoutExtension);
web.AllowUnsafeUpdates = false;
}
}
});
}
public void SetPictureUrl(string accountName, SPFolder subfolderForPictures, string fileNameWithoutExtension)
{
SPSite site = subfolderForPictures.ParentWeb.Site;
UserProfileManager userProfileManager = new UserProfileManager(SPServiceContext.GetContext(site));
UserProfile userProfile = userProfileManager.GetUserProfile(accountName);
string pictureUrl = String.Format("{0}/{1}/{2}_MThumb.jpg", site.Url, subfolderForPictures.Url, fileNameWithoutExtension);
userProfile["PictureUrl"].Value = pictureUrl;
userProfile.Commit();
}
public string GetFileNameFromAccountName(string accountName)
{
string result = accountName;
string charsToReplace = @"\/:*?""<>|"; Array.ForEach(charsToReplace.ToCharArray(), charToReplace => result = result.Replace(charToReplace, '_'));
return result;
}
public void InitializeProfileImagePicker(ProfileImagePicker profileImagePicker, SPWeb web)
{
Type profileImagePickerType = typeof(ProfileImagePicker);
FieldInfo fieldInfo = profileImagePickerType.GetField("m_objWeb", BindingFlags.NonPublic | BindingFlags.Instance);
fieldInfo.SetValue(profileImagePicker, web);
MethodInfo miLoadPictureLibraryInternal = profileImagePickerType.GetMethod("LoadPictureLibraryInternal", BindingFlags.NonPublic | BindingFlags.Instance);
if (miLoadPictureLibraryInternal != null)
{
miLoadPictureLibraryInternal.Invoke(profileImagePicker, new object[] { });
}
}
public SPFile CreateThumbnail(Bitmap original, int idealWidth, int idealHeight, SPFolder folder, string fileName)
{
SPFile file = null; Assembly userProfilesAssembly = Assembly.Load("Microsoft.Office.Server.UserProfiles, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c");
Type userProfilePhotosType = userProfilesAssembly.GetType("Microsoft.Office.Server.UserProfiles.UserProfilePhotos");
MethodInfo miCreateThumbnail = userProfilePhotosType.GetMethod("CreateThumbnail", BindingFlags.NonPublic | BindingFlags.Static);
if (miCreateThumbnail != null)
{
file = (SPFile)miCreateThumbnail.Invoke(null, new object[] { original, idealWidth, idealHeight, folder, fileName });
}
return file;
}
public SPFolder GetSubfolderForPictures(ProfileImagePicker profileImagePicker)
{
SPFolder folder = null;
Type profileImagePickerType = typeof(ProfileImagePicker);
MethodInfo miGetSubfolderForPictures = profileImagePickerType.GetMethod("GetSubfolderForPictures", BindingFlags.NonPublic | BindingFlags.Instance);
if (miGetSubfolderForPictures != null)
{
folder = (SPFolder)miGetSubfolderForPictures.Invoke(profileImagePicker, new object[] {true });
}
return folder;
}
#endregion
</pre>
<div class="brush:csharp">
</div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-13503671339799659582013-08-17T11:07:00.001-07:002013-08-18T10:49:06.169-07:00Send Calendar Meeting request in C#<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">To send Calendar meeting request through code first we need to format
string in the form of <strong><span style="color: #cc0000;">iCalendar</span></strong> Outlook event. Then we have create a
AlternateView object of <span style="color: #cc0000;"><strong>Calendar MIME type</strong></span> with the formatted string. Now if we
add this object to the Mail message, user will receive email in the format of
Outlook Event. </span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Framing the String in iCalendar format and Sending Email</span></div>
</div>
<pre class="brush:csharp">StringBuilder sw = new StringBuilder();
sw.AppendLine("BEGIN:VCALENDAR");
sw.AppendLine("VERSION:2.0");
sw.AppendLine("METHOD:PUBLISH");
sw.AppendLine("BEGIN:VEVENT");
sw.AppendLine("CLASS:PUBLIC");
sw.AppendLine(string.Format("CREATED:{0:yyyyMMddTHHmmss}", DateTime.UtcNow));
sw.AppendLine("DESCRIPTION: " + desc);
sw.AppendLine(string.Format("DTEND:{0:yyyyMMddTHHmmss}", eventendDT));
sw.AppendLine(string.Format("DTSTART:{0:yyyyMMddTHHmmss}", eventstartDT));
sw.AppendLine(string.Format("ORGANIZER:MAILTO:{0}", SPContext.Current.Web.CurrentUser.Email));
sw.AppendLine("SEQUENCE:0");
sw.AppendLine("UID:" + Guid.NewGuid().ToString());
if (lblIntLocation != null && lblIntLocation.Text != "")
sw.AppendLine("LOCATION:" + lblIntLocation.Text);
if (lblCandidateName != null && lblCandidateName.Text != "")
sw.AppendLine("SUMMARY;LANGUAGE=en-us: Scheduled for " + lblCandidateName.Text);
else
sw.AppendLine("SUMMARY;LANGUAGE=en-us: Scheduled");
sw.AppendLine("BEGIN:VALARM");
sw.AppendLine("TRIGGER:-PT15M");
sw.AppendLine("ACTION:DISPLAY");
sw.AppendLine("DESCRIPTION:Reminder");
sw.AppendLine("END:VALARM");
sw.AppendLine("END:VEVENT");
sw.AppendLine("END:VCALENDAR");
string from = SPContext.Current.Web.Site.WebApplication.OutboundMailSenderAddress;
string smtpAddress = SPContext.Current.Web.Site.WebApplication.OutboundMailServiceInstance.Server.Address;
// Assign SMTP address
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = smtpAddress;
MailMessage mailMessage = new MailMessage(from, toRecipients);
mailMessage.Subject = subject;
// Create the Alternate view object with Calendar MIME type
System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/calendar");
ct.Parameters.Add("method", "REQUEST");
//Provide the framed string here
AlternateView avCal = AlternateView.CreateAlternateViewFromString(sw.ToString(), ct);
mailMessage.AlternateViews.Add(avCal);
smtpClient.Send(mailMessage);
</pre>
<span style="font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;">Check </span><a href="http://sharepoint-tamizha.blogspot.com/2013/08/creating-icalendar-files-in-c.html" target="_blank"><strong><span style="font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;">this article</span></strong></a><span style="font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;"> to create downloadable iCalendar files in C#</span>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-23169734271991302352013-08-17T10:00:00.001-07:002013-08-17T10:00:34.000-07:00Send Email with Embedded Images in C#<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">You might came across a scenario where we need to add Images
as part of Email sent through code in HTML format. We can directly give the
<span style="color: #cc0000;"><strong>absolute url of the image</strong></span> and add the image reference in the email. But the
when the server in which the Image is hosted goes Offline, we can’t get the
image in our Email. To avoid this issue we can embed the Image in Email itself
and then it will be available to the User even if the server is offline.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">To Embed the Image in our Email we need to create an object
for <strong><span style="color: #cc0000;">LinkedResource</span></strong> with our image path. Later this LinkedResource will be added
to <strong><span style="color: #cc0000;">AlternateView</span></strong> of HTML type.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Each Image references should have <strong><span style="color: #cc0000;">one unique ID</span></strong> associated
with the Image. So first while framing the HTML we will create the Unique ID
and mention in “img src” as below,</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><img src=”cid:<strong><span style="color: #cc0000;">YOUR UNIQUE ID</span></strong>”/></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Then you need use the same unique ID (which is mentioned in
Image reference) for creating the Linked Resource object. </span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;">LinkedResource obj = new
LinkedResource(“<span style="color: #cc0000;">Physical path of the image</span>”, "image/png");</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;">Obj.ContentId = “<b><span style="color: #cc0000;">YOUR
UNIQUE ID</span>”</b>;</span><o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<o:p><span style="font-family: Calibri;"></span></o:p> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;">If your Image is hosted
in any site and doesn’t exists in physical folder, you can get Stream from the
Image and pass the <span style="color: #cc0000;"><strong>Stream</strong></span> as Input while creating object for LinkedResource.</span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">byte</span><span style="font-family: Consolas; font-size: 9.5pt;">[] imgByte = <span style="color: blue;">null</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">using</span><span style="font-family: Consolas; font-size: 9.5pt;"> (<span style="color: blue;">var</span>
webClient = <span style="color: blue;">new</span> <span style="color: #2b91af;">WebClient</span>())<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>webClient.UseDefaultCredentials = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">Uri</span> uri
= <span style="color: blue;">new</span> <span style="color: #2b91af;">Uri</span>(url);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>imgByte = webClient.DownloadData(uri);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Stream</span><span style="font-family: Consolas; font-size: 9.5pt;"> memStream = <span style="color: blue;">new</span> <span style="color: #2b91af;">MemoryStream</span>(img.ImgStream);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">LinkedResource</span><span style="font-family: Consolas; font-size: 9.5pt;"> pic6 = <span style="color: blue;">new</span>
<span style="color: #2b91af;">LinkedResource</span>(memStream, <span style="color: #a31515;">"image/png"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">pic6.ContentId =
img.ImgGuid.ToString();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Once the LinkedResource object is created we need to add to
an object of AlternateView of HTL type. Below is the full sample code snippet
for embedding images (Check inline comments for more details).</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Creating Unique
ID for adding image referrence </span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="font-family: Consolas; font-size: 9.5pt;"> GUId1 = <span style="color: #2b91af;">Guid</span>.NewGuid().ToString();<span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// frame the HTML
with the img tag and above unique id</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="font-family: Consolas; font-size: 9.5pt;"> htmlBody = <span style="color: #a31515;">"<html><body><div><img
src=\"cid:"</span> + GUId1 + <span style="color: #a31515;">"\"></div></body></html>"</span>;</span><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">//
Create alternateview object with Mime type HTML</span><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">AlternateView</span><span style="font-family: Consolas; font-size: 9.5pt;"> avHtml = <span style="color: #2b91af;">AlternateView</span>.CreateAlternateViewFromString<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>(htmlBody, <span style="color: blue;">null</span>, <span style="color: #2b91af;">MediaTypeNames</span>.<span style="color: #2b91af;">Text</span>.Html);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Create
object for Linked Resource with the Image physical path or Image Stream</span><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">LinkedResource</span><span style="font-family: Consolas; font-size: 9.5pt;"> pic1 = <span style="color: blue;">new</span>
<span style="color: #2b91af;">LinkedResource</span>(<span style="color: #2b91af;">HttpContext</span>.Current.Server.MapPath(<span style="color: #a31515;">"/_layouts/Images/header.jpg"</span>), <span style="color: #a31515;">"image/png"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Provide the
previously created Unique ID to associate the Image with the respective img
src. </span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">pic1.ContentId = GUId1;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Add the Linked
Resource to the AlternateView</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">avHtml.LinkedResources.Add(pic1);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="font-family: Consolas; font-size: 9.5pt;"> from = <span style="color: #2b91af;">SPContext</span>.Current.Web.Site.WebApplication.OutboundMailSenderAddress;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string</span><span style="font-family: Consolas; font-size: 9.5pt;"> smtpAddress = <span style="color: #2b91af;">SPContext</span>.Current.Web.Site.WebApplication.OutboundMailServiceInstance.Server.Address;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Assign SMTP
address </span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">SmtpClient</span><span style="font-family: Consolas; font-size: 9.5pt;"> smtpClient = <span style="color: blue;">new</span> <span style="color: #2b91af;">SmtpClient</span>();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">smtpClient.Host = smtpAddress;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">MailMessage</span><span style="font-family: Consolas; font-size: 9.5pt;"> mailMessage = <span style="color: blue;">new</span> <span style="color: #2b91af;">MailMessage</span>(from,
toRecipients);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">mailMessage.Subject = subject;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Add the Alternate
view with the Mail message</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">mailMessage.AlternateViews.Add(avHtml);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">mailMessage.IsBodyHtml = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">smtpClient.Send(mailMessage);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;">Happy Coding!</span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com1tag:blogger.com,1999:blog-1384698425625365255.post-10991425204265227332013-08-17T08:37:00.005-07:002013-08-17T08:38:06.315-07:00Start User Profile Synchronization Service using PowerShell<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">Using <span style="color: #cc0000;"><strong>Get-SPServiceInstance</strong></span> powershell commandlet you can get GUID
details of all the Service instances running in your server. From that pick the
GUID of your User Profile Synchronization service and use
<strong><span style="color: #cc0000;">Start-SPServiceInstance</span></strong> commandlet to start the service in the server.</span><o:p><span style="font-family: Calibri;"> </span></o:p><br />
<o:p><span style="font-family: Calibri;"> </span></o:p><span style="font-family: Calibri;"></span><br />
<span style="font-family: Calibri;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLofvsdFxf8xCxRG6nXUliX_07I-Z9uwJP_yHvU_qypS8HFFlYKAQ-imFA2juFuJYLnXhKcVkxB1gTo9EcrU0w7ptnLW3Ic2yMz_FTDwr6rhm5Ukl0aMrRglXLFWba8-UdhO1WD9iAia4g/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLofvsdFxf8xCxRG6nXUliX_07I-Z9uwJP_yHvU_qypS8HFFlYKAQ-imFA2juFuJYLnXhKcVkxB1gTo9EcrU0w7ptnLW3Ic2yMz_FTDwr6rhm5Ukl0aMrRglXLFWba8-UdhO1WD9iAia4g/s400/1.png" width="400" /></a></div>
</span>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Start-SPServiceInstance –Identity <span style="mso-spacerun: yes;"> </span>“<span style="color: #cc0000;"><strong>GUID of the Service application</strong></span>”</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Sometimes your User Profile Synchronization service might
stuck in “Starting” due to some issues in Synchronization. To Stop that
service, use the below command</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Stop-SPServiceInstance –Identity <span style="mso-spacerun: yes;"> </span>“<span style="color: #cc0000;"><strong>GUID of the Service application</strong></span>”<o:p></o:p></span></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-39111393157030710362013-08-17T08:17:00.004-07:002013-08-17T08:20:34.942-07:00Calling a method in Parent page from User Control<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>User Controls</strong></span> in ASP.net is a <span style="color: #cc0000;">reusable server control</span>
<span style="color: black;">independent</span> of Containing parent aspx page. When a User control embedded into a
Aspx Page or other control, parent control will have access to the public
properties, methods and objects of the child user control. There might be a scenario where, we need to call one of the method from Parent page or Parent
control from the Child User control.</span><br />
<span style="font-family: Calibri;"></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">So to call the method in the Parent page or control we can
create one <span style="color: #cc0000;"><strong>Event Handler</strong></span> to our User control and add the Event Handler definition
in parent control. Now from the User control we can trigger that Event which
will then execute the Event Handler definition in Parent control, <span style="mso-spacerun: yes;"> </span>then from there we can call the respective
method in Parent Control.</span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Add an Event to your User
Control.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
<span style="color: blue; font-family: Consolas; line-height: 115%;">public</span><span style="font-family: Consolas; line-height: 115%;"> <span style="color: blue;">event</span> <span style="color: #2b91af;">EventHandler</span> CreateClick;</span><o:p></o:p></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Trigger the event from the
User Control whenever required on particular action.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin: 0in 0in 0pt 0.5in; mso-add-space: auto; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="font-size: small;">CreateClick(sender,
e);</span></span><o:p><span style="font-family: Calibri;"> </span></o:p></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below is the Code behind of the User Control</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="mso-spacerun: yes;"><span style="font-family: Calibri;"> </span></span><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Event Handler Declaration</span><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">event</span> <span style="color: #2b91af;">EventHandler</span> CreateClick;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="mso-spacerun: yes;"><span style="font-family: Calibri;"> </span></span><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Triggering the Event in User control</span><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> CallParentEvent(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span>
e)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(CreateClick != <span style="color: blue;">null</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>CreateClick(sender, e);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>} <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="mso-spacerun: yes;"><span style="font-family: Calibri;"> </span></span><span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Calling the Event trigger after action
completed in User control</span><o:p></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>protected</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> btnCreateCtrl_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span>
e)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>//your code here then trigger the event<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>CallParentEvent(sender, e);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p><o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Now register the User
Control in your Parent page or control, while registering provide the <span style="color: #cc0000;"><strong>Event
Handler method</strong></span> for our custom event.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below is the Parent Control page. You can also behind the
Event handler in Page load in code behind.</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">SP</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">:</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">CreateCtrl</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: red;">id</span><span style="color: blue;">="createCtrl"</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">OnCreateClick</span><span style="color: blue;">="CreateCtrl_Click"/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">4.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Now in the Parent control
code behind, call the respective method inside the above mentioned Event
Handler (<b><span style="color: #cc0000;">CreateCtrl_Click</span></b>)</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span>
CreateCtrl_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span> e)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">try</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//Call the
respective in Parent control</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span> ex)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"></span><o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-89902266842196738432013-08-16T15:20:00.002-07:002013-08-16T15:20:59.055-07:00Get Social tags in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><strong><span style="color: #cc0000;">Social Tagging</span></strong> in SharePoint really helps in categorizing the information upon
User’s interest with meaningful tag and also improves the quality of search and
sharing the data with others.</span><br />
<span style="font-family: Calibri;"></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><strong><span style="color: #cc0000;">SocailTagManager</span></strong> is a sealed class which contains the
methods and properties used to handle social Tag data.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">We are going to use <strong><span style="color: #cc0000;">GetTags</span></strong> method from SocialTagManager
class which returns all the Tags based on the <span style="color: #cc0000;"><strong>Item URL or User Profile</strong></span>. To know
all the methods and preoperties of SocialTagManager class click <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.socialdata.socialtagmanager_members.aspx" target="_blank"><strong>here</strong></a>.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">(Check inline comments for more details).</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">var type = <span style="color: blue;">typeof</span>(SocialTagManager);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">var methods =
type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.NonPublic |
BindingFlags.Instance);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Get the method from
SocialTagManager sealed class which returns all the Tags</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">var method =
methods.FirstOrDefault(m => m.ToString() == <span style="color: #a31515;">"Microsoft.Office.Server.SocialData.SocialTag[]
GetTags(System.Uri, Int32,
Microsoft.Office.Server.SocialData.SocialItemPrivacy)"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">if</span><span style="font-family: Consolas; font-size: 9.5pt;"> (method != <span style="color: blue;">null</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">SPServiceContext</span><span style="font-family: Consolas; font-size: 9.5pt;"> serviceContext = <span style="color: #2b91af;">SPServiceContext</span>.GetContext(ospWeb.Site);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">SocialTagManager stm = <span style="color: blue;">new</span> SocialTagManager(serviceContext);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Get page URL</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Uri</span><span style="font-family: Consolas; font-size: 9.5pt;"> uri = <span style="color: blue;">new</span>
<span style="color: #2b91af;">Uri</span>(listItemURL);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Retrieve only the
public tags</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">var itemTags =
(SocialTag[])method.Invoke(stm, <span style="color: blue;">new</span> <span style="color: blue;">object</span>[] { uri, 1000, SocialItemPrivacy.PublicOnly
});<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Get the count of
the selected tag.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">likeCount = itemTags.Count(t
=> t.Term.Name.ToLower() == <span style="color: #a31515;">"i like
it"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Filter the tags
with the selected tag</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">var socialTags =
itemTags.Where(t => t.Term.Name.ToLower() == <span style="color: #a31515;">"i
like it"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">string </span><span style="font-family: Consolas; font-size: 9.5pt;">username =<span style="color: #a31515;">"";</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">foreach</span><span style="font-family: Consolas; font-size: 9.5pt;"> (var socialTag <span style="color: blue;">in</span> socialTags)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">// Each tag
will be mapped with the Profile ID</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>var user = socialTag.Owner;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">string</span>
personalSite = user.PublicUrl.AbsoluteUri;<span style="mso-spacerun: yes;">
</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>username = username + <span style="color: #a31515;">";"</span> + user.DisplayName;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-12608776989996906192013-08-16T14:43:00.001-07:002013-08-16T14:43:59.282-07:00Get Document Icon Image in SharePoint<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">While we Query the Documents from the Library and list
out the items with the Custom branding in the Webpart, Users expects to see the
related icon for the document to easily segregate and recognize the document. SharePoint makes it easier with a method in <strong><span style="color: #cc0000;">SPUtility class</span></strong>
called <span style="color: #cc0000;"><strong>SPUtility.MapToIcon()</strong></span> which gets the document icon file name, which is
being used in SharePoint. These icons are stored in 14 hive images folder. <o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span lang="EN" style="color: blue; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">string</span><span lang="EN" style="color: #505050; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;"> docicon = SPUtility.ConcatUrls(</span><span lang="EN" style="color: purple; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">"/_layouts/images"</span><span lang="EN" style="color: #505050; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">,<br />
SPUtility.MapToIcon(item.Web, SPUtility.ConcatUrls(item.Web.</span><span lang="EN" style="color: #2b91af; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">Url</span><span lang="EN" style="color: #505050; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">, item.</span><span lang="EN" style="color: #2b91af; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">Url</span><span lang="EN" style="color: #505050; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">), </span><span lang="EN" style="color: purple; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">""</span><span lang="EN" style="color: #505050; font-family: "Segoe UI","sans-serif"; font-size: 10pt; line-height: 115%; mso-ansi-language: EN;">, IconSize.Size16));</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><strong><span style="color: #cc0000;">SPUtility.MapToIcon()</span></strong> method retrieves the document from a
XML file called “<span style="color: #cc0000;"><strong>Docicon.xml</strong></span>” which maintains the mapping for the document
icons with the extension files under 14 hive XML folder. We can also use the same
XML file to get the respective icon for the Document based on the document
extension. In case if you are listing the documents from some other source other
than document library.</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>private</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">string</span>
ReturnExtension(<span style="color: blue;">string</span> fileExtension)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">XmlDocument</span>
document = <span style="color: blue;">new</span> <span style="color: #2b91af;">XmlDocument</span>();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>document.Load(<span style="color: #2b91af;">SPUtility</span>.GetGenericSetupPath(<span style="color: blue;">string</span>.Empty) + <span style="color: #a31515;">@"\TEMPLATE\XML\DOCICON.XML"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">XmlNodeList</span>
xnList =<span style="mso-spacerun: yes;"> </span>document.SelectNodes(<span style="color: #a31515;">"//DocIcons/ByExtension/Mapping[@Key='"</span>
+ fileExtension.ToLower() + <span style="color: #a31515;">"']"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: blue;">string</span>
returnURL = <span style="color: #a31515;">""</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(xnList.Count > 0)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">foreach</span>
(<span style="color: #2b91af;">XmlNode</span> xn <span style="color: blue;">in</span>
xnList)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>returnURL =
xn.Attributes[<span style="color: #a31515;">"Value"</span>].Value;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">break</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>returnURL = <span style="color: #a31515;">"icgen.gif"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span>
returnURL;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-65834821065411118222013-08-16T14:19:00.002-07:002013-08-16T14:21:03.810-07:00Get User Profile properties in SharePoint<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><span style="color: #cc0000;"><strong>User Profile Service</strong></span> application
maintains User Profiles for all the Users in SharePoint and synchronizes with
the <strong><span style="color: #cc0000;">Active Directory</span></strong> or with your Custom DB based on the configuration. If you
want to access the User Profile properties from Web Application make sure your
<span style="color: #cc0000;">Web Application is configured with any of the User Profile Service application</span>.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Check <a href="http://sharepoint-tamizha.blogspot.com/2013/08/create-user-profile-service-application.html" target="_blank"><strong>here</strong></a> to see Creation of User Profile Service application.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Follow below steps to check the Service connections.</span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Navigate to <strong><span style="color: #cc0000;">Central
Administration</span></strong> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;">
<strong><span style="color: #cc0000;">Application Management</span></strong> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;">
<strong><span style="color: #cc0000;">Manage Web applications</span></strong></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Select your <strong><span style="color: #cc0000;">Web Application</span></strong>
and Click on the <strong><span style="color: #cc0000;">Service Connections</span></strong> from Ribbon.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfZZgbIp2p6wVZ0KDGoEFeTUoGqtSOEIF2AQ-qN21DrMo3JFWnWaWwwVbZ93YjUlvfX9HCMYbM7daOnYZl94ihjNiagz3ZBfbIclUAUSApq306gkTNptGwQcf-aui4gOgTL7RMCfYzmOSP/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfZZgbIp2p6wVZ0KDGoEFeTUoGqtSOEIF2AQ-qN21DrMo3JFWnWaWwwVbZ93YjUlvfX9HCMYbM7daOnYZl94ihjNiagz3ZBfbIclUAUSApq306gkTNptGwQcf-aui4gOgTL7RMCfYzmOSP/s640/1.png" width="640" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
</div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Make sure <span style="color: #cc0000;"><strong>User Profile
Service application</strong></span> is selected from the list and click <strong><span style="color: #cc0000;">OK</span></strong>.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd3gkcNIU2blmF4oeW7_lWFwzVQn0XpnK5ur_2n2CJqJ1Xhv1xxVvyaRTaa7QWNBQWNxko9u-pfqSpfMHqMyxFu9QDkrl7305FJ-X6oKnSobKwQkmpTpWyJFdHZdAbFukv7BtjYZL4SEMV/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd3gkcNIU2blmF4oeW7_lWFwzVQn0XpnK5ur_2n2CJqJ1Xhv1xxVvyaRTaa7QWNBQWNxko9u-pfqSpfMHqMyxFu9QDkrl7305FJ-X6oKnSobKwQkmpTpWyJFdHZdAbFukv7BtjYZL4SEMV/s400/2.png" width="352" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">To access a specific user profile, we need call the <b><span style="color: #cc0000;">UserProfileManager</span></b>
class to create an object <span style="mso-spacerun: yes;"> </span>for the <b><span style="color: #cc0000;">UserProfile</span></b>
and to get the Properties of the User from the User Profile Database.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">SPSecurity</span><span style="font-family: Consolas; font-size: 9.5pt;">.RunWithElevatedPrivileges(<span style="color: blue;">delegate</span>()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">using</span> (<span style="color: #2b91af;">SPSite</span> site = <span style="color: blue;">new</span>
<span style="color: #2b91af;">SPSite</span>(web.Url))<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">using</span> (<span style="color: #2b91af;">SPWeb</span> objWeb = site.OpenWeb())<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: blue;">string</span>
strDisplayName = <span style="color: blue;">string</span>.Empty;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">string</span>
strMySiteURL = <span style="color: blue;">string</span>.Empty;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">string</span>
strEmail = <span style="color: blue;">string</span>.Empty;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">SPServiceContext</span>
sc = <span style="color: #2b91af;">SPServiceContext</span>.GetContext(web.Site);</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #6aa84f;">//Get the User Profile Service configured to the current site</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">UserProfileManager</span>
objUserProfileManager = <span style="color: blue;">new</span> <span style="color: #2b91af;">UserProfileManager</span>(sc);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">UserProfile</span>
profile = <span style="color: blue;">null</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: #6aa84f;">//Check whether the specified User
exists in the UserProfile<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(objUserProfileManager.UserExists(accountName))<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #6aa84f;">//Get the User Profile using the
Profile Manager<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>profile = objUserProfileManager.GetUserProfile(accountName);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #6aa84f;">//Now you can get all the
Properties of the User from this object<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>strDisplayName =
profile.DisplayName;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>strMySiteURL = profile.PublicUrl.ToString();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>strEmail = profile[“WorkEmail”].Value();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;">
</span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>}<span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>});<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">If you need full access for all the User Profiles, you need
to have “<strong><span style="color: #cc0000;">Manage User Profile</span></strong>” rights. By default, everyone will have read access
to all the User Profiles.<o:p></o:p></span></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-33387312267491201352013-08-16T13:40:00.002-07:002013-08-18T07:16:53.498-07:00Create User Profile Service application in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">The <strong><span style="color: #cc0000;">User Profile service application</span></strong> stores information
about users in a central location. It maintains <span style="color: #cc0000;"><strong>User Profiles</strong></span> for each User with
detailed information maintained as <span style="color: #cc0000;"><strong>User Properties</strong></span>. These User Profiles will be
and <span style="color: #cc0000;"><strong>synchronized with the Active Directory</strong></span> or with your Custom DB based on the
configuration. <span style="mso-spacerun: yes;"> </span>These Information will be
useful for provisioning My Sites, enable social computing features such as
social tagging and newsfeeds, and create and distribute profiles across
multiple sites and farms, you must enable the User Profile service application.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Follow below steps to Create User Profile Service
application.</span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Navigate to <strong><span style="color: #cc0000;">Central
Administration</span></strong> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;">
<strong><span style="color: #cc0000;">Application Management</span></strong> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;">
<span style="color: #cc0000;"><strong>Manage Service Applications.</strong></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Select <strong><span style="color: #cc0000;">New</span></strong> from the Ribbon
and click on <span style="color: #cc0000;"><strong>User Profile Service Application</strong></span> from the dropdown.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
<span style="font-family: Calibri;">Note: Make Sure that “<span style="color: #cc0000;"><strong>SharePoint Web Services
root</strong></span>” application pool is running in IIS.<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWgW7CZe9dGRtdHSE4h9Zy_VWuJyQO1fL7BupBHHyVozaWHdXuWiew-bmbrCzXP8tZSsQCje7v2vawLG7YfdkfTtLkQQWgJMGivsAsh2dVtlo4K4LlN8onzvao35gArY_W6588E4P4sUmz/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWgW7CZe9dGRtdHSE4h9Zy_VWuJyQO1fL7BupBHHyVozaWHdXuWiew-bmbrCzXP8tZSsQCje7v2vawLG7YfdkfTtLkQQWgJMGivsAsh2dVtlo4K4LlN8onzvao35gArY_W6588E4P4sUmz/s640/1.png" width="640" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
</div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
<span style="font-family: Calibri;">Fill-in the required information like
<span style="color: #cc0000;">Service application Name, application pool details and the Application pool
account details.<o:p></o:p></span></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
<span style="font-family: Calibri;">(Note: It’s better to have separate account
for this configuration, to track down the issues).<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
<span style="font-family: Calibri;">The Application Pool account which
configure here must have the following privileges.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l3 level1 lfo2; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Farm Administrator</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l3 level1 lfo2; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Local Administrator in the
server where SharePoint is running as application server.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l3 level1 lfo2; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Log on locally policy in
the server where SharePoint is running as application server.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi537nsRDqyAZl5X3Q7y34mkM_OJ-YPDnjtbFgxD850sbRRtH9YxH4AxezBfSWSInhsTh5oa-hQGiE-vlBoQGh0YXTImNXwS4hSpN-IYR4anOwGfZulsuxQ97RsIBt8mnLvJ3PNWyz3TYdi/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi537nsRDqyAZl5X3Q7y34mkM_OJ-YPDnjtbFgxD850sbRRtH9YxH4AxezBfSWSInhsTh5oa-hQGiE-vlBoQGh0YXTImNXwS4hSpN-IYR4anOwGfZulsuxQ97RsIBt8mnLvJ3PNWyz3TYdi/s1600/2.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Calibri;">Choose<span style="color: #cc0000;"> <strong>domain and username</strong></span> in site naming format if your
application have more than one domain to avoid the Naming conflicts.</span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">SharePoint creates 3
different databases for storing the User Profile Information.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 58.5pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><b><span style="color: #cc0000;">Profile database</span></b> – Stores
all the User Profile Properties.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 58.5pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> <span style="color: #cc0000;">
</span></span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><span style="color: #cc0000;"><b>Synchronization</b> <b>database</b></span>
– Stores all the configuration information for synchronizing profile data from
external sources such as the Active Directory or BDC. </span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 58.5pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><b><span style="color: #cc0000;">Social tagging database -</span></b>
Stores social tags and notes created by users. Each social tag and note is mapped
with a tag owner.</span><br />
</div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">4.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Once the User Profile
Service application is created. We need to make sure the below Services are
running in the server.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 58.5pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">User Profile Service</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 58.5pt; mso-add-space: auto; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">User Profile
Synchronization service</span> </div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">5.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">To check the above, again
Navigate to <b><span style="color: #cc0000;">Central Administration</span></b> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;"><span style="color: #cc0000;">
<b>Application Management</b></span> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;">
<b><span style="color: #cc0000;">Manage Services on Server</span></b>.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRO7FAV9lOqEjvuesI4ZAKDYif31d-QxquKR-7lCzmH7KVzU54z5ZjkPmkKDNdfeJuf-xKKcwNovqkhdb9BTABn3wsK8nVBrfJOI-dqpk7riVs89f_xOOMaVwawp88IOWL3ijWVsL1neEc/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRO7FAV9lOqEjvuesI4ZAKDYif31d-QxquKR-7lCzmH7KVzU54z5ZjkPmkKDNdfeJuf-xKKcwNovqkhdb9BTABn3wsK8nVBrfJOI-dqpk7riVs89f_xOOMaVwawp88IOWL3ijWVsL1neEc/s640/3.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaG9o8c_e0Fe2FyarbUnnEPLdM4iTDpJY0qoIZsttymTXyxxnrU4jFWwq1TTYFdfcS-KGsB3YEATjm-cmD8dKoajJZR9IPKpRBe6Qvw6B2z9CxSM5H93AomXXiZur05HJNJTOjCNUX4_ZM/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaG9o8c_e0Fe2FyarbUnnEPLdM4iTDpJY0qoIZsttymTXyxxnrU4jFWwq1TTYFdfcS-KGsB3YEATjm-cmD8dKoajJZR9IPKpRBe6Qvw6B2z9CxSM5H93AomXXiZur05HJNJTOjCNUX4_ZM/s640/4.png" width="640" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
</div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">6.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Once the Services are the
started in the Server, now we need to <strong><span style="color: #cc0000;">Create the Service Connections</span></strong> for
Synchronizing the User Profiles from our Source like <strong><span style="color: #cc0000;">Active Directory</span></strong>.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">7.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">To Create a new Connection.
Navigate to <span style="mso-spacerun: yes;"> </span><b><span style="color: #cc0000;">Central Administration</span></b>
</span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;"> <b><span style="color: #cc0000;">Application
Management</span></b> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;"> <b><span style="color: #cc0000;">Manage
Service applications</span></b> and click on the newly created the Service
application.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz4i28DlVnBGvjRr9lRIf3mcsbgEbedinIPI_0WfjUQMeQlYQ-e4TIhHBwMJeG65hU4WO0-gUkFncFPnZvMBZ3Odmr8oRAcwmTlnxLXbDHdBIstk3cQTLxL2O3yOXNHS8AxYceHXaIn-tR/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz4i28DlVnBGvjRr9lRIf3mcsbgEbedinIPI_0WfjUQMeQlYQ-e4TIhHBwMJeG65hU4WO0-gUkFncFPnZvMBZ3Odmr8oRAcwmTlnxLXbDHdBIstk3cQTLxL2O3yOXNHS8AxYceHXaIn-tR/s640/5.png" width="640" /></a></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">8.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Click on <b><span style="color: #cc0000;">Configure
Synchronization Connections</span></b> link under <span style="color: #cc0000;"><b>Synchronization</b> </span>section.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6lDeLLR6qXO9S_Khmj22aPpa0XxdSQmBWIFQzhFLHZkNQcy_h_2r474xC9Xks3uJ0ue5GkKJZsfk8Xqm3CLk-jZtJRT9o6c_uImjiSu3j5RY_tUdo767oZIj4XXCrx81kBwiS2NlTQirt/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6lDeLLR6qXO9S_Khmj22aPpa0XxdSQmBWIFQzhFLHZkNQcy_h_2r474xC9Xks3uJ0ue5GkKJZsfk8Xqm3CLk-jZtJRT9o6c_uImjiSu3j5RY_tUdo767oZIj4XXCrx81kBwiS2NlTQirt/s640/6.png" width="640" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">9.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Now Click on the <strong><span style="color: #cc0000;">Create New
Connection</span></strong> link to create the connections.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto;">
</div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto;">
<span style="font-family: Calibri;"> Fill-in all the required details<span style="mso-ansi-language: EN;"> </span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 63pt; mso-add-space: auto; mso-list: l0 level3 lfo4; text-indent: -0.25in;">
<span lang="EN" style="font-family: Symbol; mso-ansi-language: EN; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><b><span lang="EN" style="mso-ansi-language: EN;">Connection Name</span></b><span lang="EN" style="mso-ansi-language: EN;">: ADConnection</span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 63pt; mso-add-space: auto; mso-list: l0 level3 lfo4; text-indent: -0.25in;">
<span lang="EN" style="font-family: Symbol; mso-ansi-language: EN; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><b><span lang="EN" style="mso-ansi-language: EN;">Forest Name</span></b><span lang="EN" style="mso-ansi-language: EN;">: ad.local</span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 63pt; mso-add-space: auto; mso-list: l0 level3 lfo4; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><b><span lang="EN" style="mso-ansi-language: EN;">Account Name</span></b><span lang="EN" style="mso-ansi-language: EN;">: domainname\accname</span></span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEROdHevJN8p0mMfeAMB_VCgzirSNAe3gYqjEvAcspO1gIZf_ySf8r8_5iaYMPyzv_KTKwLI-Y6DocX_fVrmAPKb3V7OZjxs4qEszEAzIQa5z6ZFd3N-G9Wq_GKgyaIOq2eSF7mFpWZn9k/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="586" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEROdHevJN8p0mMfeAMB_VCgzirSNAe3gYqjEvAcspO1gIZf_ySf8r8_5iaYMPyzv_KTKwLI-Y6DocX_fVrmAPKb3V7OZjxs4qEszEAzIQa5z6ZFd3N-G9Wq_GKgyaIOq2eSF7mFpWZn9k/s640/7.png" width="640" /></a></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 63pt; mso-add-space: auto; mso-list: l0 level3 lfo4; text-indent: -0.25in;">
</div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Specify the Provider name if you want to synchronize from
any other source.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">10.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Once done with creating the
Synchronize Connections, now we are good to go to <b><span style="color: #cc0000;">Start Full Synchronization</span>.
</b>Select <strong><span style="color: #cc0000;">Start Full Synchronization</span></strong> link under <strong><span style="color: #cc0000;">Synchronization</span></strong>
Section.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_n1NAFU4XttsJdNVspo9xQOiMwHIeGUxLksp-94LhMYzVhKd1kOKU57ifk-zBW1BMX198Am4kLahAgG_hY8q9M3p2cr5l-C9bhPUPnvBuu-UwRV5Sf6Xmg8rZ7RgsnzUvGRQ_XEaCMgUo/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_n1NAFU4XttsJdNVspo9xQOiMwHIeGUxLksp-94LhMYzVhKd1kOKU57ifk-zBW1BMX198Am4kLahAgG_hY8q9M3p2cr5l-C9bhPUPnvBuu-UwRV5Sf6Xmg8rZ7RgsnzUvGRQ_XEaCMgUo/s640/8.png" width="640" /></a><o:p><span style="font-family: Calibri;"> </span></o:p></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto;">
<span style="font-family: Calibri;">You can check the Profile Synchronization status in the Right section,
where you get the more details about the User Profiles.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzAs7dw-VeucUoVVm4gsdSDZwWsMzLCR9xDnnIswxHRIoFRAp5Q4ngHNE1L8uJex4A1Fa298VGud0yaHJ0JZH6jOGut27kz7FnQKX0kyF3vyl1egnTZIQsK1YdxskVioWQgV-vnqNi8Llr/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzAs7dw-VeucUoVVm4gsdSDZwWsMzLCR9xDnnIswxHRIoFRAp5Q4ngHNE1L8uJex4A1Fa298VGud0yaHJ0JZH6jOGut27kz7FnQKX0kyF3vyl1egnTZIQsK1YdxskVioWQgV-vnqNi8Llr/s320/9.png" width="320" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 22.5pt; mso-add-space: auto;">
</div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 22.5pt; mso-add-space: auto; mso-list: l2 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">11.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Now configure the<span style="color: #cc0000;">
<strong>Incremental Synchronization</strong></span> which will make sure your User Profiles are up-to-date
with Active Directory. Click on <strong><span style="color: #cc0000;">Configure Synchronization timer job</span></strong> link under <span style="color: #cc0000;"><strong>Synchronization</strong></span> Section to change
the occurrence of the Timer Job.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrwy5V0wn9efst50k2J0MGRIRACTn98b1jSIw9epG8wTTEQV3iZ5i_Wi29rToa06QGqgeexwH-ZJu2fNIXCZafdv1ButglgAIxhmH8FgEfSJwLPcImIKXfSosUakPrY8Hk3BMwGa4ErqWc/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrwy5V0wn9efst50k2J0MGRIRACTn98b1jSIw9epG8wTTEQV3iZ5i_Wi29rToa06QGqgeexwH-ZJu2fNIXCZafdv1ButglgAIxhmH8FgEfSJwLPcImIKXfSosUakPrY8Hk3BMwGa4ErqWc/s640/10.png" width="640" /></a></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-45863477899936839682013-08-15T14:16:00.003-07:002013-08-17T08:18:38.556-07:00Calling JavaScript method from Server Side under Update Panel Postback<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">When you try to use the normal way of <span style="color: #cc0000;"><strong>Calling a JavaScript
method from Sever side in a Update Panel Postback</strong></span>, your JavaScript method will
never be called. Since Update Panel makes Asynchronous calls you need to use “<span style="color: #cc0000;"><strong>ScriptMananger</strong></span>”
to register your client script from code behind instead of Page.ClientScript.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">If your registering the<span style="color: #cc0000;"><strong> Script under Update Panel Postback</strong></span>
use the below line to register your client script. </span><br />
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #2b91af; font-family: Consolas;">ScriptManager</span><span style="font-family: Consolas;">.RegisterStartupScript(<strong><span style="color: red;">updatepanelID</span></strong>,
<span style="color: red;"><strong>updatepanelID</strong></span>.GetType(), <span style="color: #a31515;">"Reset"</span>,
<span style="color: #a31515;">"MethodName();"</span>, <span style="color: blue;">true</span>);<o:p></o:p></span></div>
</div>
<span style="font-family: Calibri;">If your registering the <span style="color: #cc0000;"><strong>Script under normal Postback</strong></span> use the
below line to register your client script.<o:p></o:p></span><br />
<br />
<span style="font-family: Consolas;">Page.ClientScript.RegisterStartupScript(<span style="color: blue;">this</span>.GetType(),
<span style="color: #a31515;">"Reset"</span>, <span style="color: #a31515;">"MethodName();"</span>,
<span style="color: blue;">true</span>);<o:p></o:p></span><br />
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-72168382843568397272013-08-15T13:50:00.004-07:002013-08-16T13:53:45.317-07:00Get SharePoint List Items using JavaScript Client Object Model<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">In one of <a href="http://sharepoint-tamizha.blogspot.com/2013/08/get-choice-field-values-from-sharepoint.html" target="_blank">my previous article</a>, we saw about <span style="color: #cc0000;"><strong>JavaScript
Client Object model</strong></span> and getting the <span style="color: #cc0000;">Choice values of SharePoint Choice Field</span>
using client object model. Now we will go through how to <span style="color: #cc0000;"><strong>get the List Items from
SharePoint List using JavaScript Client Object model.</strong></span></span><br />
<span style="font-family: Calibri;"></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">One restriction in the JavaScript Client Object model is we
can’t access the data from different site collections and it can <span style="color: #cc0000;"><strong>run only in
SharePoint environment</strong></span>.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">JavaScript Client Object model gives better performance to
the Users since it makes only <span style="color: #cc0000;"><strong>asynchronous calls</strong></span> to the Server side and
retrieves data. It also <span style="color: #cc0000;"><strong>loads only the requested data</strong></span> and not more that (ie. It
retrieves only the Requested content from the server and it doesn’t load all
the properties of the object)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below code snippet defines the retrieval of list items from SharePoint
List using JavaScript model. (Check the inner comments for more details)</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><script type=<span style="color: maroon;">"text/javascript"</span>><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;">/*Below line
will make sure your JavaScript method will be called only after the SP.js
file loaded at the client side*/<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">ExecuteOrDelayUntilScriptLoaded(QueryFollowUrl,
<span style="color: maroon;">"sp.js"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">function</span><span style="font-family: Consolas; font-size: 9.5pt;"> QueryFollowUrl()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>//Gets the Client context of the Web</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> context
= <span style="color: blue;">new</span> SP.ClientContext.get_current();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>/*if your list exists in the subsite uncomment
the below line and remove the above declaration*/<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span><span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;">//var context = new SP.ClientContext(‘/siteurl’);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> web =
context.get_web();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//Change the
List Name with yours</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">this</span>.list =
web.get_lists().getByTitle(</span><b><span style="color: red; font-family: Consolas;">'ListName'</span></b><span style="font-family: Consolas; font-size: 9.5pt;">);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
camlQuery = <span style="color: blue;">new</span> SP.CamlQuery();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//Reframe the
Caml quey as per your requirements</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> query= <span style="color: maroon;">"<View><Query><Where><IsNotNull><FieldRef
Name='ID'/></IsNotNull></Where><OrderBy><FieldRef
Name='Order0'
Ascending='true'/></OrderBy></Query></View>"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>camlQuery.set_viewXml(query);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>listItems = <span style="color: blue;">this</span>.list.getItems(camlQuery);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>context.load(list); <span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">/*Now mention
all the required filed internal name, since data from these fields only will
be retrieved*/</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>context.load(listItems, <span style="color: maroon;">'Include(LinkTitle0,RedirectUrl,Order0)'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//Makes
asynchronous call to the Server, which will return the JSON objects</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>context.executeQueryAsync(Function.createDelegate(<span style="color: blue;">this</span>, <span style="color: blue;">this</span>.successFollow),
Function.createDelegate(<span style="color: blue;">this</span>, <span style="color: blue;">this</span>.failedFollow));<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span> <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;">//you can get
the Error details if your Execution fails using get_message() method</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">function</span><span style="font-family: Consolas; font-size: 9.5pt;"> failedFollow(sender, args) <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
errorMsg = args.get_message();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;">/*Upon successful
execution, Success delegate method will be called and all the requested
objects will the loaded with contents*/</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">function</span><span style="font-family: Consolas; font-size: 9.5pt;"> successFollow(sender, args) <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
ListEnumerator = <span style="color: blue;">this</span>.listItems.getEnumerator();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">while</span>
(ListEnumerator.moveNext()) <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
collection = ListEnumerator.get_current();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">/*Using
get_item method you can pass the Field Internal name mentioned earlier and
get the data in that respective column, if you try to use any other column
other than we mentioned earlier, it will throw you error.*/<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
linkTitle = collection.get_item(<span style="color: maroon;">'LinkTitle0'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
itemUrl = collection.get_item(<span style="color: maroon;">'RedirectUrl'</span>).get_url();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//your code
here<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>} <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"></script><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-48635780718559622872013-08-15T13:18:00.003-07:002013-08-15T13:18:55.211-07:00Print option in SharePoint 2010 using JavaScript<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">You might came across a scenario where you need to allow the
Users to Print part of the Page. This can be done through JavaScript, by
<span style="color: #cc0000;">finding the respective control and Print all the contents inside that Control</span>
by calling <span style="color: #cc0000;"><strong>print()</strong></span> method in JavaScript.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below code snippet will find the specified control in the
Page and prints the contents inside that control.</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">function</span><span style="font-family: Consolas; font-size: 9.5pt;"> PrintWebPart() {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
WebPartElementID = <span style="color: maroon;">"</span></span><b><span style="color: red; font-family: Consolas;">printableArea</span></b><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">"</span><span style="font-family: Consolas; font-size: 9.5pt;">; <span style="color: darkgreen;">//
ID of the control to be printed</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
bolWebPartFound = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(document.getElementById != <span style="color: blue;">null</span>) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//Create
html to print in new window</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
PrintingHTML = <span style="color: maroon;">'<HTML>\n<HEAD><meta
name="WebPartPageExpansion" content="full" />\n'</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//Take
data from Head Tag</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(document.getElementsByTagName != <span style="color: blue;">null</span>) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
HeadData = document.getElementsByTagName(<span style="color: maroon;">"HEAD"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(HeadData.length > 0)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingHTML +=
HeadData[0].innerHTML;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingHTML += <span style="color: maroon;">'\n</HEAD>\n<BODY>\n'</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
pgTitle = document.getElementById(<span style="color: maroon;">'pageTitle'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>title = <span style="color: maroon;">""</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(pgTitle != <span style="color: blue;">null</span> && pgTitle !=
undefined) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(document.all) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>title = pgTitle.innerText;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>} <span style="color: blue;">else</span>
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>title = pgTitle.textContent;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
currentDate = getCurrentDate();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
header = <span style="color: maroon;">"<table border='0' width='100%'><tr><td><h1><a
href=\"/ " target=\"_blank\">Page</a></h1></td><td
style='padding:5px;font-size: 1.1em;font-weight: bold;'
align='right'>"</span> + currentDate + <span style="color: maroon;">"</td></tr><tr><td
style=\"font-size: 1.3em;font-weight: bold;\">"</span> +
title + <span style="color: maroon;">"</td></tr></table>"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
WebPartData = document.getElementById(WebPartElementID);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingHTML += header;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(WebPartData != <span style="color: blue;">null</span> && WebPartData
!= undefined) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingHTML +=
WebPartData.innerHTML;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>bolWebPartFound = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span>
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>bolWebPartFound = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>alert(<span style="color: maroon;">'Cannot
Find Web Part'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingHTML += <span style="color: maroon;">'\n</BODY>\n</HTML>'</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">//Open new
window to print</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(bolWebPartFound) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
PrintingWindow = window.open(<span style="color: maroon;">""</span>, <span style="color: maroon;">"PrintWebPart"</span>, <span style="color: maroon;">"toolbar,width=800,height=600,scrollbars,resizable,menubar"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingWindow.document.open();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>PrintingWindow.document.write(PrintingHTML);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: darkgreen;">// Open
Print Window</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PrintingWindow.print();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">function</span><span style="font-family: Consolas; font-size: 9.5pt;"> getCurrentDate() {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
currentTime = <span style="color: blue;">new</span> Date();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> month
= currentTime.getMonth() + 1;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> day =
currentTime.getDate();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> year
= currentTime.getFullYear();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
currentDate = day + <span style="color: maroon;">"-"</span> + month +
<span style="color: maroon;">"-"</span> + year;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span>
currentDate;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com1tag:blogger.com,1999:blog-1384698425625365255.post-75340144760525467552013-08-15T11:44:00.002-07:002013-08-18T01:16:21.535-07:00Share Contents to Social Network sites in SharePoint<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">Sharing the URL of the Page and Contents through Social
Network will increases the exposure of the Site. If you want to increase the
exposure and get attention for your public site, you can simply use some of the
API’s provided by the Social sites. We just need to call the URL with Passing
your Page informations.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b><span style="color: #cc0000;">Facebook</span></b>:</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Redirect the User to below URL by replacing the below bolded
content with appropriate Content.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: maroon; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">'http://www.facebook.com/sharer.php?s=100&p[title]=
'</span><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"> + </span><b><span style="color: red; font-family: Consolas; font-size: 10pt; line-height: 115%;">title</span></b><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"> </span><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">+ <span style="color: maroon;">'&p[summary]='</span> + </span><b><span style="color: red; font-family: Consolas;">desc</span></b><span style="color: red; font-family: Consolas; font-size: 10pt; line-height: 115%;"> </span><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">+ <span style="color: maroon;">'&p[url]='</span> + </span><b><span style="color: red; font-family: Consolas; font-size: 10pt; line-height: 115%;">linkUrl</span></b><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"> </span><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">+ <span style="color: maroon;">'&p[images][0]='</span>, <span style="color: maroon;">'sharer'</span>,
<span style="color: maroon;">'toolbar=0,status=0'<o:p></o:p></span></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b><span style="color: #cc0000;">Twitter</span>:</b></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Redirect the User to below URL by replacing the below bolded
content with appropriate Content.</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">'http://twitter.com/home?status=Title
'</span><span style="font-family: Consolas; font-size: 9.5pt;"> + </span><b><span style="color: red; font-family: Consolas;">desc</span></b><span style="font-family: Consolas;"> </span><span style="font-family: Consolas; font-size: 9.5pt;">+ <span style="color: maroon;">'<span style="mso-spacerun: yes;"> </span>Page Url:'</span>
+ </span><b><span style="color: red; font-family: Consolas;">linkUrl</span></b><span style="color: red; font-family: Consolas;"> </span><span style="font-family: Consolas; font-size: 9.5pt;">+ <span style="color: maroon;">''</span>, <span style="color: maroon;">'twitter'</span>, <span style="color: maroon;">'toolbar=0,status=0'<o:p></o:p></span></span></div>
<span style="color: maroon; font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: #cc0000; font-family: Calibri;"><b>Google+:</b></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Redirect the User to below URL by replacing the below bolded
content with appropriate Content.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: maroon; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">"https://plus.google.com/share?url="</span><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"> + escape(</span><b><span style="color: red; font-family: Consolas;">linkUrl</span></b><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">);</span><o:p></o:p></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><</span><span lang="EN" style="color: maroon; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">script</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"> </span><span lang="EN" style="color: red; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">type</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">="text/javascript"><br style="mso-special-character: line-break;" />
<br style="mso-special-character: line-break;" />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: darkgreen; font-family: Consolas; font-size: 9.5pt;">/*We have used
Field Controls to store Page Title and Page Description and added the Field
Controls in the Pagelayout, So that Page Title and description of each Page
available as a Control*/</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">function</span><span style="font-family: Consolas; font-size: 9.5pt;"> shareData(sitename) {<span style="color: darkgreen;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
pgTitle = document.getElementById(<span style="color: maroon;">'pageTitle'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(pgTitle != <span style="color: blue;">null</span> && pgTitle !=
undefined && pgTitle != <span style="color: maroon;">''</span>) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(document.all) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>title = pgTitle.innerText;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>} <span style="color: blue;">else</span>
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>title = pgTitle.textContent;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
pgDesc = document.getElementById(<span style="color: maroon;">'pageDescription'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(pgDesc != <span style="color: blue;">null</span> && pgDesc !=
undefined && pgDesc != <span style="color: maroon;">''</span>) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(document.all) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>desc = pgDesc.innerText;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>} <span style="color: blue;">else</span>
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>desc = pgDesc.textContent;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span>
linkUrl = window.location.href;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">var</span> body
= desc;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(sitename == <span style="color: maroon;">'facebook'</span>) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>u = location.href;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>t = title;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>window.open(<span style="color: maroon;">'http://www.facebook.com/sharer.php?s=100&p[title]=
'</span> + title + <span style="color: maroon;">'&p[summary]='</span> +
desc + <span style="color: maroon;">'&p[url]='</span> + linkUrl + <span style="color: maroon;">'&p[images][0]='</span>, <span style="color: maroon;">'sharer'</span>,
<span style="color: maroon;">'toolbar=0,status=0'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span> <span style="color: blue;">if</span> (sitename == <span style="color: maroon;">'twitter'</span>)
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>window.open(<span style="color: maroon;">'http://twitter.com/home?status=Title '</span> + desc + <span style="color: maroon;">'<span style="mso-spacerun: yes;"> </span>Page Url:'</span> + linkUrl + <span style="color: maroon;">''</span>, <span style="color: maroon;">'twitter'</span>, <span style="color: maroon;">'toolbar=0,status=0'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span> <span style="color: blue;">if</span> (sitename == <span style="color: maroon;">'google'</span>)
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>linkUrl = <span style="color: maroon;">"https://plus.google.com/share?url="</span>
+ escape(linkUrl);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>window.open(linkUrl, <span style="color: maroon;">''</span>, <span style="color: maroon;">'toolbar=0,status=0'</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"></</span><span lang="EN" style="color: maroon; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">script</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> Now you can call "</span><span style="font-family: Consolas; font-size: x-small;"><span style="font-size: small;"><strong><span style="color: #cc0000;">shareData(param)</span></strong><span style="font-family: Calibri;">"</span></span> <span style="font-family: Calibri; font-size: small;">JavaScript method from your page by changing the appropirate input Parameter(<span style="color: maroon; font-family: Consolas; font-size: x-small;"><span style="color: #cc0000; font-size: small;"><strong>facebook,twitter,google</strong></span>)</span> whenever the User clicks on respective share button.</span></span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-33572304129031925152013-08-15T11:07:00.001-07:002013-08-15T11:07:38.953-07:00Open Page in Modal dialog in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">In many cases, we may need to <strong><span style="color: #cc0000;">Open a Page in popup window</span></strong> to
avoid many redirections between pages. In SharePoint 2010, you can see many
popup windows opening with good look and feel <span style="mso-spacerun: yes;"> </span>also avoids page redirections and keep user in
same page. In SharePoint 2007 with help of JQuery, dialog framework can be
enabled and used. But it has some limitations and time consuming.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below code snippet will help you to Open a Page in modal
Popup window. Copy the below code and add to <strong><span style="color: #cc0000;">Content Editor webpart</span></strong> of your Page.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">(Check inline comments for more details)</span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><</span><span lang="EN" style="color: maroon; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">script</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"> </span><span lang="EN" style="color: red; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">type</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">="text/javascript"><br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">//Below method will Open the page in Popup</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">function</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"> OpenPopup(strPageURL)
<br />
{<br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">var</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"> options = <span class="skimwords-unlinked">SP.UI.$create_DialogOptions</span>();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Setting the URL of the page to be
opened in Popup</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><br />
options<span class="skimwords-unlinked">.url</span> = strPageURL;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Setting Height and Width of the
Popup</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">options<span class="skimwords-unlinked">.width</span> =
750; </span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">options<span class="skimwords-unlinked">.height</span> =
500; <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Sepcify the method name which
captures the Callback event</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">options<span class="skimwords-unlinked">.dialogReturnValueCallback</span>
= <span class="skimwords-unlinked">Function.createDelegate</span>( </span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">null</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">, CloseCallback); <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Opens the Popup window</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span class="skimwords-unlinked"><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">SP.UI.ModalDialog.showModalDialog(</span></span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">options); </span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">return false;</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">}<br />
<br />
</span><span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Callback event fires once the Popup window is closed</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">function</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">
CloseCallback(strReturnValue, target) </span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Return value will be “OK” when User
clicked OK</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">if</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"> (strReturnValue ===
<span class="skimwords-unlinked">SP.UI.DialogResult.OK</span>) </span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
{<br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">alert(</span><span lang="EN" style="color: maroon; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">"Retuned
Ok"</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">);</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: darkgreen; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">// Return value will be “Cancel” when
User clicked Cancel</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">if</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"> (strReturnValue ===
<span class="skimwords-unlinked">SP.UI.DialogResult.cancel</span>) </span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
{<br />
</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">alert(</span><span lang="EN" style="color: maroon; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">"Returned
Cancel"</span><span lang="EN" style="color: #555555; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">);</span><span lang="EN" style="color: #555555; font-family: "Segoe UI","sans-serif"; font-size: 10pt; mso-ansi-language: EN;"><br />
}<br />
}<br />
<br />
</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"></</span><span lang="EN" style="color: maroon; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">script</span><span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;">><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span lang="EN" style="color: blue; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN;"><o:p> </o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;">Whenever a Page is opened in Modal Dialog box, SharePoint
will add a <span style="color: #cc0000;"><strong>Query string</strong></span> with the Page URL “<strong><span style="color: #cc0000;">isDlg=1</span></strong>”. This Query string differentiates
between a normal page and Modal Dialog box. You might have noticed, when a page
is opened in Modal dialog box few sections like <span style="color: #cc0000;"><strong>Top bar, Quick launch</strong></span> might be disappeared.
</span></o:p><span style="font-family: Calibri;"></span></div>
<span style="font-family: Calibri;"></span><br />
<span style="font-family: Calibri;"><div class="MsoNormal" style="margin: 0in 0in 10pt;">
Using the above query string value SharePoint identifies the
Modal dialog box and applies<strong> <span style="color: #cc0000;">/_layouts/styles/dlgframe.css</span></strong> instead of
CoreV4.css. <span style="mso-spacerun: yes;"> </span>If you want any custom controls to be hidden
in the Modal Dialog box you can “<strong><span style="color: #cc0000;">s4-notdlg</span></strong>” class to the control which will be
identified and made hidden in Modal dialog box.</div>
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Times New Roman;">
</span></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-88100292902967145392013-08-15T06:50:00.003-07:002013-08-15T13:51:47.059-07:00Get Choice Field values from SharePoint List using Javascript Client Object model<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><strong><span style="color: #cc0000;">JavaScript Client Object model</span></strong> makes an <span style="color: #cc0000;">Asynchronous call</span> to
the Server through <span style="color: #cc0000;">WCF service</span> and sends a <span style="color: #cc0000;">XML request</span> and then this request
will be processed at the Server Side and return the <span style="color: #cc0000;">JSON response.</span></span><br />
<span style="color: #cc0000; font-family: Calibri;"></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><strong><span style="color: #0b5394;">Scenario</span>:</strong></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">To Get all the values of a Choice Field from SharePoint List
and bind to a drop down control without using Server Side controls and Object
model.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><strong><span style="color: #0b5394;">Solution</span>:</strong></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">We can use JavaScript Client Object model to retrieve the
choice values and bind to the dropdown.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">First, we need to Register the <span style="color: #cc0000;"><strong>SP.js</strong></span> file in our code,
through which only the <span style="color: #cc0000;"><strong>HTTP request</strong></span> will be created and sent to the server. Registering
this JS file is important since in SharePoint 2010 all the JS files will not be
downloaded to the Client for better performance and only the required files
will be downloaded to the Client.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">You may now ask How does SharePoint ensure that only the
required files are downloaded to the client machine? The answer is the
<strong><span style="color: #cc0000;">SharePoint 2010 Script on Demand (SOD) framework</span></strong>. SOD ensures that only the
required files are downloaded to the client and provides options to load them
in the background after the page has completed loading. SOD is a class defined
in the init.js file and contains methods for loading scripts, registering
script dependencies, executing methods within a loaded page, and event
notification. You use SOD to load the OOB SharePoint js files and your own JavaScript
files.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><script><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">SP.SOD.RegisterSod("SP.js", "\_layouts\SP.js");<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="color: #6aa84f;">/* Below line will make sure to call your JavaScript method only
after the SP.js file loaded at Client side*/<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">ExecuteOrDelayUntilScriptLoaded(<span style="color: #cc0000;">GetChoiceValues</span>,"sp.js");<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"></script><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below is the script will get all the choice values and adds
to dropdown. Add a Content Editor web part to page and copy the below content
to the HTML of the Content Editor webpart.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">(Check the inline comments for more description)</span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.15in;" valign="top" width="590"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><script type="text/javascript"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">SP.SOD.RegisterSod("SP.js", "\_layouts\SP.js");<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">ExecuteOrDelayUntilScriptLoaded(<span style="color: #cc0000;">GetChoiceValues</span>,"sp.js");<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">function <span style="color: #cc0000;">GetChoiceValues</span>()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">// Get the Client Context of the Current Web</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var context = new SP.ClientContext.get_current();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var web = context.get_web();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="color: #674ea7;">// Get the list, Change the List name appropirately</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">this.taskList = web.get_lists().getByTitle("<span style="color: #cc0000;">SportsTeam</span>");</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"></span> </div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="color: #674ea7;">// Get Filed Collection from the List</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">this.fields= this.taskList.get_fields();</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="color: #674ea7;">// Get the respective choice field (choice field) from the list using the Internal name<o:p></o:p><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var deptChoiceField =
context.castTo(this.taskList.get_fields().getByInternalNameOrTitle("<span style="color: #cc0000;">SportsCategory</span>"),SP.FieldChoice);</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="color: #674ea7;">/* To Use all the objects and their properties we need to Load and Call the Execute method which creates the XML resquest and results us with the response*/</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">context.load(this.taskList);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">context.load(this.fields);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">context.load(deptChoiceField);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">/*Here we are calling the Execute method after loading all the required properties*/</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">/*Based on the execution result, Sucess or Failure methods will be executed */</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">context.executeQueryAsync(Function.createDelegate(this,
this.onSuccessMethod),Function.createDelegate(this,this.onFailureMethod));<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">function onFailureMethod(sender, args) {<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">// We can the exact error details using get_message method of args</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>alert("Error Occured:
"+ args.get_message());<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">} <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">function onSuccessMethod(sender, args) <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var context = new SP.ClientContext.get_current();</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">// Converting the Field to SPFieldChoice from the execution results</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var myChoicesfield =
context.castTo(this.fields.getByInternalNameOrTitle("SportsCategory"),SP.FieldChoice);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">//get_choices() method will return the array of choices provided in the field</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var choices = myChoicesfield.get_choices();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">var elem = document.getElementById("Choices");<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">if(elem != "" && elem != undefined)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>divHtml
="<table><tr><td><select id='sports'> <option
value='SelectSport' name='Sport'>Select Sport</option>";<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>l= choices.length;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="color: #674ea7; font-family: Calibri;">// Now here we are just looping through the array of choices and framing the html dropdown control</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>for(i=0;i<choices.length;i++)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>divHtml+="<option
value='"+choices[i]+"'>"+choices[i]+"</option>";<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>divHtml+="</select></td><td><input
type='button' id='gobutton' class='gobuttonStyle' value='Go'
onclick='javascript:setQS()'/></td></tr></table>";<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>elem.innerHTML = divHtml;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">}</span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"></script><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><div
style="padding-left:15px;"id="Choices"></div><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-51144907605048423652013-08-14T11:54:00.001-07:002013-08-14T11:55:51.295-07:00"Mark as Answer" feature in SharePoint 2010 Discussion boards<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">SP
2010 Discussion boards is enhanced from earlier versions, still it is just
another type of list template which enables saving posts and replies. The gap
between the SharePoint forum lists and real Discussion Boards services (like
those available on the internet) is quite big, and include some very basic and
critical missing features such as:<o:p></o:p></span></span><br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">There is no discussion board index that enables
managing multiple discussion boards under groups/subjects.<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">Editing capabilities are very limited<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">No ability to control the visibility of specific
discussion boards<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">No out-of-the-box ability to manage abusive posts<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">Limited Look N feel - very far from Internet-style
forums<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">Rank, like/dislike<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="line-height: 115%; mso-bidi-font-size: 12.0pt;"><span style="font-family: Calibri;">If
we have to extend all rich functions, we need to opt for “Third party tools”.
However, some of the features (with limited look N feel) can be managed by few customizations.
Below customization is to achieve “<strong><span style="color: #cc0000;">Mark as Answer</span></strong>” feature without much custom
coding.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<b><span style="font-size: 12pt; line-height: 115%;"><span style="font-family: Calibri;"><span style="color: #cc0000;">Steps to
extend this Function:</span></span></span></b>
</div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Create List (OOTB) of type
“<span style="color: #cc0000;"><strong>Discussion boards</strong></span>”</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">By default, </span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">a.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">It contains two content
types, “<strong><span style="color: #cc0000;">Message</span></strong>” & “<strong><span style="color: #cc0000;">Discussion</span></strong>”. Add new column of type “<strong><span style="color: #cc0000;">Yes/No</span></strong>” with name
“</span><a href="http://hdl-pcs469781:44444/sites/MnM-KM/Projects/_layouts/FldEdit.aspx?List=%7BC34A8848%2D6ADB%2D4466%2DB1AC%2D817E16191A88%7D&Field=Mark%5Fx0020%5Fas%5Fx0020%5Fanswer"><span style="color: windowtext; text-decoration: none; text-underline: none;"><span style="color: #cc0000; font-family: Calibri;"><strong>MarkedAnswer</strong></span></span></a><span style="font-family: Calibri;">”
under “Message” content type.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 1in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">b.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">List contains three views (Flat,
Subject, and Threaded). Edit the “Flat” View and make newly added column
“<strong><span style="color: #cc0000;">MarkedAnswer</span></strong>” as visible. It would appear as below..</span><span style="mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><span style="font-family: Calibri;"><v:stroke joinstyle="miter"><v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></span></v:shapetype></span><o:p></o:p></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3stT1S57k8jjOPGqkCV9w5bCzOZ8eSfu3MXPB0MISLQkaC5tFC9sFYT60MAynxheUy7iFz42nWN1VnQq1fxOEZRulOMOBsSHMLIYcX1Z_2ah44EWWrPziC_MdgT8lIy0ZVmi7mbsI1lG4/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="93" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3stT1S57k8jjOPGqkCV9w5bCzOZ8eSfu3MXPB0MISLQkaC5tFC9sFYT60MAynxheUy7iFz42nWN1VnQq1fxOEZRulOMOBsSHMLIYcX1Z_2ah44EWWrPziC_MdgT8lIy0ZVmi7mbsI1lG4/s640/1.png" width="640" /></a></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Discussion boards use
“<strong><span style="color: #cc0000;">Thread.xsl</span></strong>” to display above layout.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-list: Ignore;"><em><span style="font-family: Calibri;">4)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></em></span><span style="font-family: Calibri;">Take a backup of
“C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\LAYOUTS\XSL” folder before updating any xsl file<em>,
<span style="color: red;">as it will impact globally to farm.</span></em></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">5)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Open “<strong><span style="color: #cc0000;">Thread.xsl</span></strong>” file and
find template “</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"><</span><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">xsl:template</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%;">=</span><span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;">"<span style="color: blue;">StatusBar</span>"<span style="color: blue;">>”</span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">6)</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Add below code between
<td> and <div> tag to highlight background <br />
<v:shapetype coordsize="21600,21600" id="_x0000_t202" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter">
<v:path gradientshapeok="t" o:connecttype="rect">
</v:path></v:stroke></v:shapetype></span><br />
<table cellpadding="0" cellspacing="0" style="width: 100%px;">
<tbody>
<tr>
<td style="background-color: transparent; border: rgb(0, 0, 0);"><div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="background: yellow; color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt; mso-highlight: yellow;">----Highlight status
bar---</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:attribute</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">"<span style="color: blue;">style</span>"<span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:choose</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:when</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">test</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">"<span style="color: blue;">$thisNode/@MarkedAnswer
= 'Yes'</span>"<span style="color: blue;">></span>background-color:
#00bb00<span style="color: blue;"></</span><span style="color: #2b91af;">xsl:when</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:choose</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:attribute</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="background: yellow; color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt; mso-highlight: yellow;">------OR---------Add add
answered image as below-----------------</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:choose</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:when</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">test</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">"<span style="color: blue;">$thisNode/@Mark_x0020_as_x0020_answer
= 'Yes'</span>"<span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">img</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">src</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">'<span style="color: blue;">/_layouts/images/kpinormal-0.gif</span>'<span style="color: blue;"> </span><span style="color: red;">alt</span><span style="color: blue;">=</span>''<span style="color: blue;"> /></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:when</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #2b91af; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">xsl:choose</span><span style="color: blue; font-family: Consolas; font-size: 8.5pt; mso-bidi-font-size: 9.5pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
</div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<w:wrap anchorx="margin" anchory="margin" type="none">
<w:anchorlock>
</w:anchorlock></w:wrap><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"> 7) Save the <strong><span style="color: #cc0000;">Thread.xsl file and “Restart IIS”</span></strong> to
reflect this change on site. This should display as below…</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9AOsMyIECKH6iAYhNa1aNIyeHv98h5z6TXvU6KvkwTIgXzfNWgkNl1-U2tiJg-I9dXJw4U5CjQBu0Sd62RL-_jgebfKXQQZpArbu3hhP6T2ZvpBVCxAyQPEVLbnf1-_0HCAcJJO3YpOdw/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="389" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9AOsMyIECKH6iAYhNa1aNIyeHv98h5z6TXvU6KvkwTIgXzfNWgkNl1-U2tiJg-I9dXJw4U5CjQBu0Sd62RL-_jgebfKXQQZpArbu3hhP6T2ZvpBVCxAyQPEVLbnf1-_0HCAcJJO3YpOdw/s640/2.png" width="640" /></a></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><br style="mso-special-character: line-break;" />
</span></div>
</div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-84700580016138978052013-08-14T11:24:00.000-07:002013-08-18T11:47:07.531-07:00Triggering Workflow by Anonymous User in SharePoint Using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Problem:</b><span style="mso-spacerun: yes;"> </span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.5in;">
<span style="font-family: Calibri;">We have a Request for Information
form that can be accessed anonymously and the anonymous users have Add and View
privileges to the respective list. What we want is when the <span style="color: #cc0000;">user submits the
form to have a workflow kick off</span> that sends an email to the user who submitted
the form using the email address within the form data and also send an email to
an administrator.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">However, we are seeing some problems with anonymous users
and workflow playing nice together.</span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">If a user is logged in
(windows authentication), then the form works as expected, the data is stored
into the list, the user is directed to the appropriate page and the workflow
runs.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><span style="color: #cc0000;">If no workflow is tied to
the list,</span> the anonymous user can submit their request for information as
expected. The data goes into the list and the user is directed to the
appropriate page.</span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;"><span style="color: #cc0000;">If a workflow is attached
to the list,</span> the user can still submit their request and the data makes it into
the list, but the workflow is not started and remains with Failed on Starting
error.</span><o:p><span style="font-family: Calibri;"> </span></o:p></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Work Around</b>:</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.25in;">
<span style="font-family: Calibri;">Normally <span style="color: #cc0000;">Anonymous Users doesn’t
have permission to trigger a workflow automatically</span>. Below are the steps to
enable anonymous users to trigger workflow automatically.<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Create a user or use the
existing user and make sure that user has given proper <span style="color: #cc0000;">write permissions to the
list,</span> to which the workflow is attached.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Through Powershell we can
iterate through the items in the list by impersonating the anonymous user with
the user mentioned in the first step.</span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Copy the below code to the
notepad and save it as “<b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">filename.ps1</span></b>”,
Change the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">SiteCollectionUrl, Site title
and List name</span></b> to the appropriate one.</span><br />
<br />
<span style="font-family: Calibri;"></span>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> [System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> Add-PSSnapin Microsoft.SharePoint.Powershell<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> Start-SPAssignment -Global<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> $Site = Get-SPSite <b style="mso-bidi-font-weight: normal;"><span style="color: red;">http://servername:portnumber/</span><o:p></o:p></b></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> $web = $Site.AllWebs | where { $_.title -eq "<b style="mso-bidi-font-weight: normal;"><span style="color: red;">Site Title</span></b>"}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>if ($web -ne
$null) <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>{<span style="mso-tab-count: 1;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span>$list =$web.Lists["<span style="color: red;"><strong>List Name</strong></span>"]<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>if($list -ne
$null)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;">
<span style="font-family: Calibri;">foreach
($item in $list.Items | where {$_.Workflows.InternalState -ne
"Completed"})<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>{<span style="mso-tab-count: 1;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;">
</span>$item.Update()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>$list.Update()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-tab-count: 2;"> </span><span style="mso-spacerun: yes;"> </span>start-sleep 45<span style="mso-tab-count: 6;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>}<span style="mso-tab-count: 4;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>$Web.Dispose()<span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> $Site.Dispose ()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"> Stop-SPAssignment –Global <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
</td>
</tr>
</tbody></table>
</div>
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">4.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Now we need to schedule this script in Task scheduler. Navigate
to <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Start</span></b> <span style="font-family: Wingdings; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-char-type: symbol; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span></span><span style="font-family: Calibri;"> <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Administrative tools</span></b> <span style="font-family: Wingdings; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-char-type: symbol; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span></span><span style="font-family: Calibri;">
<b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Task Scheduler</span></b></span><o:p><span style="font-family: Calibri;"> </span></o:p></div>
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">5.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Click on the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Create Task</span></b>
from the Actions pane in the right.</span><br />
<span style="font-family: Calibri;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<div class="separator" style="clear: both; text-align: center;">
<span style="mso-no-proof: yes;"><span style="font-family: Calibri;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTB-i2hiF28FN8NjAskkj0PEiN16GwVHnLeLYWJa3XLNF_7xe0svYjU_Zih7t76ics73qLLYd0dv91Ib3DV_tzVo7wCil_K9mtGPs9X_d-YTEnQ5q7SmwnN1GwLVA5pGGb0OSDBoxa5ln0/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTB-i2hiF28FN8NjAskkj0PEiN16GwVHnLeLYWJa3XLNF_7xe0svYjU_Zih7t76ics73qLLYd0dv91Ib3DV_tzVo7wCil_K9mtGPs9X_d-YTEnQ5q7SmwnN1GwLVA5pGGb0OSDBoxa5ln0/s640/1.png" width="640" /></a></span></span></div>
<span style="mso-no-proof: yes;"><span style="font-family: Calibri;">
</span></span><o:p></o:p></div>
<br />
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">6.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Give the name of the job and the select the account which we
mentioned in the first point which has the <span style="color: #cc0000;">write permissions</span> to the list.</span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjllIEZaI47AcAv8zE8DO9pFNxeFvE7HFj4u_l4e9uhIStSoKeY6aLYmioWSgrCg0ly9Tp_q_cp0-7pEsEDG-UtdDmxQcO9pSZ5eSgCXqibguOr1Iamvq2O7nQdm1gOCncUdjktUM54KiYl/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjllIEZaI47AcAv8zE8DO9pFNxeFvE7HFj4u_l4e9uhIStSoKeY6aLYmioWSgrCg0ly9Tp_q_cp0-7pEsEDG-UtdDmxQcO9pSZ5eSgCXqibguOr1Iamvq2O7nQdm1gOCncUdjktUM54KiYl/s640/1.png" width="640" /></a></div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;"><br /></span></span></span>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">7.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">In the<strong><span style="color: #cc0000;"> Triggers</span></strong> tab, create a schedule which suits the
requirement.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMF78UP9VYYSfPsSTEy5txVaGsR3_sqi4hQ_SQCSNvhW55qp1INqgmU2tw1x3iCtQ8JmFzER9QfRIcKWpxa9rNN5Tva2DMzcTJuW7YTu_rXJGMiLM1iburR_6B25vkAm6mVzrNx9iw1JB/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMF78UP9VYYSfPsSTEy5txVaGsR3_sqi4hQ_SQCSNvhW55qp1INqgmU2tw1x3iCtQ8JmFzER9QfRIcKWpxa9rNN5Tva2DMzcTJuW7YTu_rXJGMiLM1iburR_6B25vkAm6mVzrNx9iw1JB/s400/3.png" width="400" /></a></div>
<span style="mso-no-proof: yes;"><v:shape id="Picture_x0020_5" o:spid="_x0000_i1027" style="height: 296.25pt; mso-wrap-style: square; visibility: visible; width: 468pt;" type="#_x0000_t75"><span style="font-family: Calibri;"><v:imagedata o:title="" src="file:///C:\Users\DINESH~1.NAT\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png"></v:imagedata></span></v:shape></span><o:p></o:p><br />
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">8.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">In the <strong><span style="color: #cc0000;">Actions tab</span></strong>, click new to specify the action.</span><br />
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<span style="font-family: Calibri;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<div class="separator" style="clear: both; text-align: center;">
<span style="mso-no-proof: yes;"><span style="font-family: Calibri;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1AKQizeL6jUSsQ16iTl_SpFAVUhEZdElFrMD6w0kITLfMorkVKBhz5DaZQk2n3Ihx8bKAzoCWaFTrSz354MtKU5s7Gwv6bqiAA7FzuUUUegNRpUgVWnoLr9c1BNHwkOEN-Z4PQ71SF7R7/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1AKQizeL6jUSsQ16iTl_SpFAVUhEZdElFrMD6w0kITLfMorkVKBhz5DaZQk2n3Ihx8bKAzoCWaFTrSz354MtKU5s7Gwv6bqiAA7FzuUUUegNRpUgVWnoLr9c1BNHwkOEN-Z4PQ71SF7R7/s400/4.png" width="400" /></a></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;"><br /></span></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">9.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR" style="text-align: left;"></span><span style="font-family: Calibri; text-align: left;">Select “<b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Start a Program</span></b>”
from the dropdown and type Powershell.exe in the Program/Script.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Calibri; text-align: left;">Then in
arguments, mention the path of the script file we saved in 3</span><sup style="font-family: Calibri; text-align: left;"><span style="font-size: x-small;">rd</span></sup><span style="font-family: Calibri; text-align: left;"> step.</span></div>
</div>
<div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin: 0in 0in 0pt 0.5in;">
<span style="font-family: Calibri;">Example:<o:p></o:p></span></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="line-height: normal; margin: 0in 0in 0pt 0.5in;">
<span style="color: #cc0000; font-family: Calibri;">-command
"& 'D:\WorkflowAnonymous.PS1'"</span><br />
<br /></div>
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo2; text-indent: -0.25in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgHhn_WBcKVLgC1Yu0hvUqmb_jO3ve3O94-LjGCNfYEdnFrPF9zwzwU2DWLY0Hd-aXNKe29DnQVjtohJpLIfgrL1gowG8dFDB39id53GomXRMzxYmIeknnr5QD9H59Oxc_FTVoOpQLBc2y/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="518" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgHhn_WBcKVLgC1Yu0hvUqmb_jO3ve3O94-LjGCNfYEdnFrPF9zwzwU2DWLY0Hd-aXNKe29DnQVjtohJpLIfgrL1gowG8dFDB39id53GomXRMzxYmIeknnr5QD9H59Oxc_FTVoOpQLBc2y/s640/5.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">10.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Once the<b><span style="color: #cc0000;"> Job has been scheduled</span></b>, try to add a new item to the
list using the anonymous access and wait for the scheduled job to run. Once the
job has completed then check workflow status, <b><span style="color: #cc0000;">Now the workflow has been
triggered by anonymous access</span></b>.<o:p></o:p></span><br />
<span style="font-family: Calibri;"><br /></span>
<span style="font-family: Calibri;"><br /></span>
<span style="font-family: Calibri;"><br /></span></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-27615676626376642072013-08-14T10:44:00.001-07:002013-08-18T09:29:35.696-07:00Copy ListItem Unique Permission between Lists in SharePoint 2010 using C#<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">In some cases, we may need to copy List Items from one list
to another list including the Permissions. So while copying the ListItem to the
new List, by Default <span style="color: #cc0000;"><strong>Parent permissions</strong></span> will be inherited to the newly created
Items which is called as <span style="color: #cc0000;"><strong>Role Inheritance</strong></span>. To copy the unique permissions also, first we need to <strong><span style="color: #cc0000;">break the Role Inheritance</span></strong>
and <strong><span style="color: #cc0000;">copy the permissions</span></strong> as well.</span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Below is the simple example, where we have same lists resides in two different
site collections and now we are copying the Unique permissions from one list to
another list.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
</div>
<pre class="brush:csharp"> class Program
{
static void Main(string[] args)
{
try
{
Console.Write("Source Site URL:");
string srcSiteUrl = Console.ReadLine();
Console.Write("Source List Name:");
string srcListName = Console.ReadLine();
Console.Write("Target Site URL:");
string tgtSiteUrl = Console.ReadLine();
Console.Write("Target List Name:");
string tgtListName = Console.ReadLine();
using (SPSite srcSite = new SPSite(srcSiteUrl))
{
SPWeb srcWeb = srcSite.OpenWeb();
SPList srcList = srcWeb.Lists[srcListName];
Collection<splistiteminfo> itemCollecInfo = srcList.GetItemsWithUniquePermissions();
if (itemCollecInfo.Count > 0)
{
using (SPSite tgtSite = new SPSite(tgtSiteUrl))
{
SPWeb tgtWeb = tgtSite.OpenWeb();
SPList tgtList = tgtWeb.Lists[tgtListName];
foreach (SPListItemInfo itemInfo in itemCollecInfo)
{
SPListItem srcItem = srcList.GetItemById(itemInfo.Id);
SPListItem tgtItem = tgtList.GetItemById(itemInfo.Id);
foreach (SPRoleAssignment roleAssign in srcItem.RoleAssignments)
{
SPSecurity.RunWithElevatedPrivileges(delegate
{
if (tgtItem != null)
{
tgtItem.BreakRoleInheritance(false);
tgtItem.RoleAssignments.Add(roleAssign);
Console.WriteLine("Item ID: " + tgtItem.ID + " Roles Copied: " + roleAssign.Member);
}
});
}
}
}
}
}
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("Error Occurred: " + ex.Message);
Console.ReadLine();
}
}
}</pre>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-40758717293857965712013-08-14T09:44:00.005-07:002013-08-18T12:12:44.570-07:00Custom Field type in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #4f81bd; font-family: Cambria; font-size: medium;">Custom Field for Uploading Documents and Images:</span><br />
<span style="color: #4f81bd; font-family: Cambria;"><br /></span>
<span style="color: #4f81bd; font-family: Cambria;"><b>Scenario</b>:</span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">A Custom List has a column for <b style="mso-bidi-font-weight: normal;">Image and Document URL</b> which is of type <b style="mso-bidi-font-weight: normal;">Hyperlink or Picture; </b>it is used to store the URL of the Document
or Image.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>In order to add an
item to this list, we need to perform two steps.</span></div>
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Upload the Picture or
Document to some Library </span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo2; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Copy the URL of the
uploaded Item and Paste them in the “<b style="mso-bidi-font-weight: normal;">Hyperlink
or Picture</b>” field. </span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">This seems to be a tedious process and looking for an option
to <b style="mso-bidi-font-weight: normal;"><u>upload Image or Document in the same
page of Custom List Add Item/Edit Item form</u></b>.</span> </div>
<h3 style="margin: 10pt 0in 0pt;">
<span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Solution:<o:p></o:p></span></span></span></h3>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">To reduce the two step process, we have created a <b style="mso-bidi-font-weight: normal;">Custom field type. </b>This <b style="mso-bidi-font-weight: normal;">Custom Field type</b> allows us to upload
the <b style="mso-bidi-font-weight: normal;">Image/ Document</b> directly in the
Custom list Dialog box itself, which generates a <b style="mso-bidi-font-weight: normal;">thumbnail/link</b> to show the <b style="mso-bidi-font-weight: normal;">Image/Document</b>
in the list view respectively. If we click on the <b style="mso-bidi-font-weight: normal;">thumbnail</b> a popup with the real size picture will open and a <b style="mso-bidi-font-weight: normal;">Link</b> to download the Document.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">We have created an option to configure the default <b style="mso-bidi-font-weight: normal;">Document or Image library </b>in the List settings<b style="mso-bidi-font-weight: normal;">, </b>which is used to store all the <b style="mso-bidi-font-weight: normal;">Documents/Images</b> and a reference to
this document will be maintained in the list column.</span></div>
<h4 style="margin: 10pt 0in 0pt;">
<em><span style="color: #4f81bd;"><span style="font-family: Cambria;">Column types<o:p></o:p></span></span></em></h4>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l4 level1 lfo1; text-indent: -0.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span></b><span dir="LTR"></span><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Enhanced Hyperlink - </b>Field
to upload the Documents to the respective Document Library selected in the List
settings.</span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l4 level1 lfo1; text-indent: -0.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span></b><span dir="LTR"></span><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Enhanced Image – </b>Field
to upload the Images to the respective Image Library selected in the List
settings.</span><br />
<span style="font-family: Calibri;"><br /></span></div>
<h3 style="margin: 10pt 0in 0pt;">
<span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Implementation:<o:p></o:p></span></span></span></h3>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo6; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Create a public custom
field type class, which inherits from one of the built-in field type classes,
such as <b style="mso-bidi-font-weight: normal;">SPFieldBoolen, SPFieldChoice, </b>or<b style="mso-bidi-font-weight: normal;"> SPFieldText </b>and name it as<b style="mso-bidi-font-weight: normal;"> ImageEnhancerField.cs</b>.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo6; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Create another Class file
which needs to inherit from <b style="mso-bidi-font-weight: normal;">BaseFieldControl</b>
and name it as <b style="mso-bidi-font-weight: normal;">ImageEnhancerFieldControl.cs</b>.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo6; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Add <b style="mso-bidi-font-weight: normal;">SharePoint</b> mapped folders to <b style="mso-bidi-font-weight: normal;">Control
Templates</b> and <b style="mso-bidi-font-weight: normal;">XML</b>.</span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo6; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">4.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Create a User Control under
<b style="mso-bidi-font-weight: normal;">Control Templates</b> folder and name it
as <b style="mso-bidi-font-weight: normal;">ImageEnhancerFieldControl.ascx.</b></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Note:
User Control </b>must be deployed directly under<b style="mso-bidi-font-weight: normal;"> Control Templates </b>and not in any<b style="mso-bidi-font-weight: normal;"> sub-folders.</b><span style="mso-tab-count: 1;"> </span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo6; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">5.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Create an <b style="mso-bidi-font-weight: normal;">XML file</b> known as the <b style="mso-bidi-font-weight: normal;">field type deployment file</b> under <b style="mso-bidi-font-weight: normal;">XML </b>folder and name it as <b style="mso-bidi-font-weight: normal;">fldtypes_ImageEnhancer.xml</b>.</span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo6; text-indent: -0.25in;">
</div>
<h3 style="margin: 10pt 0in 0pt;">
<span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Creating the Custom Field Class: <span style="mso-spacerun: yes;"> </span>[<span style="font-weight: normal; mso-bidi-font-weight: bold;">ImageEnhancerField.cs]<o:p></o:p></span></span></span></span></h3>
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo7; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Inherit the Class from <b style="mso-bidi-font-weight: normal;">SPFieldText </b>and add two public
constructors using specific parameter list signatures and forward parameters to
base class constructors with matching signatures.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; margin: auto auto auto 0.5in; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">class</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">ImageEnhancerCustomField</span>:
<span style="color: #2b91af;">SPFieldText</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//constructors<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">ImageEnhancerCustomField</span>
(<span style="color: #2b91af;">SPFieldCollection</span> fields, <span style="color: blue;">string</span> fieldName)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>: <span style="color: blue;">base</span>(fields,
fieldName)<span style="mso-spacerun: yes;"> </span>{ }<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">public</span>
<span style="color: #2b91af;">ImageEnhancerCustomField</span> (<span style="color: #2b91af;">SPFieldCollection</span> fields, <span style="color: blue;">string</span> typeName, <span style="color: blue;">string</span>
displayName)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>: <span style="color: blue;">base</span>(fields,
typeName, displayName)<span style="mso-spacerun: yes;"> </span>{ }</span><o:p></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in;">
</div>
<br />
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo7; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Override the <b style="mso-bidi-font-weight: normal;">FieldRenderingControl</b> property and
define the get value.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; margin: auto auto auto 0.5in; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">override</span>
<span style="color: #2b91af;">BaseFieldControl</span> FieldRenderingControl<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">get</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">SPContext</span>.Current.List.EnableAttachments
= <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">BaseFieldControl</span>
fieldControl = <span style="color: blue;">new</span> <span style="color: #2b91af;">ImageEnhancerControl</span>();<span style="color: #2b91af;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>fieldControl.FieldName = <span style="color: blue;">this</span>.InternalName;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span>
fieldControl;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 0pt; mso-add-space: auto;">
</div>
</td>
</tr>
</tbody></table>
<br />
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo7; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Then Override the <b style="mso-bidi-font-weight: normal;">GetValidatedString</b> method and return
the value which needs to store in the Field.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; margin: auto auto auto 0.5in; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">override</span>
<span style="color: blue;">string</span> GetValidatedString(<span style="color: blue;">object</span> value)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>return</span><span style="font-family: Consolas; font-size: 9.5pt;"> value.ToString().ToUpper();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoListParagraph" style="line-height: normal; margin: 0in 0in 0pt; mso-add-space: auto;">
</div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in;">
</div>
<h3 style="margin: 10pt 0in 0pt;">
<span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Creating FieldControl.ascx [<span style="font-weight: normal; mso-bidi-font-weight: bold;">ImageEnhancerFieldControl.ascx</span>]<o:p></o:p></span></span></span></h3>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">SharePoint Rendering
Template</b> can work only when we place the ascx file directly under Control
Templates folder not into any sub folders. [Please check comments inside]<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">SharePoint</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">:</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">RenderingTemplate</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: red;">Id</span><span style="color: blue;">="ImageEnhancerControlRender"</span> <span style="color: red;">runat</span><span style="color: blue;">="server"></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">Template</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">asp</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">:</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">UpdatePanel</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: red;">ID</span><span style="color: blue;">="UpdatePanel1"</span> <span style="color: red;">runat</span><span style="color: blue;">="server"></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">ContentTemplate</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;"><!-- To show
the preview of the image in Edit form --><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">Image</span> <span style="color: red;">ID</span><span style="color: blue;">="ImgThumb"</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;"><!-- To browse
to the file from the physical location --> <o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">FileUpload</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">id</span><span style="color: blue;">="flUpload"</span> <span style="color: red;">size</span><span style="color: blue;">="40"/></span><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;"><!-- To Delete
the Image reference in the Edit form --><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">Button</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">ID</span><span style="color: blue;">="btnDelete"</span> <span style="color: red;">Text</span><span style="color: blue;">="Delete"/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;"><!-- To
validate the Type of File uplodaed --><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">RegularExpressionValidator</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span>
<span style="color: red;">ErrorMessage</span><span style="color: blue;">="Please
upload png,jpeg or gif files only"</span> <span style="color: red;">ControlToValidate</span><span style="color: blue;">="flUpload"</span> <span style="color: red;">id</span><span style="color: blue;">="ImgRegularExpressionValidator"</span> <span style="color: red;">validationexpression</span><span style="color: blue;">="^.+\.(png|jpeg|jpg|gif)$"</span>
<span style="color: red;">SetFocusOnError</span><span style="color: blue;">="True"></</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">RegularExpressionValidator</span><span style="color: blue;">></span><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;"><!-- To Error
Message in case of any issues --><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">Label</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">id</span><span style="color: blue;">="lblMessage"</span> <span style="color: blue;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">Label</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">id</span><span style="color: blue;">="lblMessage2"</span> <span style="color: blue;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">Label</span> <span style="color: red;">runat</span><span style="color: blue;">="server"</span> <span style="color: red;">id</span><span style="color: blue;">="lblMessage3"</span> <span style="color: blue;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"></</span><span style="color: maroon;">ContentTemplate</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">asp</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">:</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">UpdatePanel</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"></</span><span style="color: maroon;">Template</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">SharePoint</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">:</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">RenderingTemplate</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
</td>
</tr>
</tbody></table>
<br />
<h3 style="margin: 10pt 0in 0pt;">
<span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Creating Custom Field Control Class [<span style="font-weight: normal; mso-bidi-font-weight: bold;">ImageEnhancerFieldControl</span>]<o:p></o:p></span></span></span></h3>
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo8; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">1.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Inherit the Class from <b style="mso-bidi-font-weight: normal;">BaseFieldControl</b> and override the
DefaultTemplateName property and define the get property value.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 477.9pt;" valign="top" width="637"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">override</span>
<span style="color: blue;">string</span> DefaultTemplateName<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #00b050;">//Name
of the SharePoint Rendering Template defined in the ascx file</span>.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">get</span>
{ <span style="color: blue;">return</span> <span style="color: #a31515;">"ImageEnhancerControlRender"</span>;
}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}</span><o:p></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo8; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">2.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Override the <b style="mso-bidi-font-weight: normal;">Value</b> property and define the get &
set values. The Value of this field will be stored in this format “<b style="mso-bidi-font-weight: normal;">File location full path, Thumbnail URL</b>”.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">override</span>
<span style="color: blue;">object</span> Value<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">get</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>EnsureChildControls();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>if</span><span style="font-family: Consolas; font-size: 9.5pt;"> (hasfile)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//if
it’s a new file return the path to the file and the path to the thumbnail</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span>
httppath + filename + <span style="color: #a31515;">" ,"</span> +
thumbnailpath;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(!ImgThumb.Visible)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//if it’s going to be erase return a blank string</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span> <span style="color: #a31515;">""</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<span style="mso-spacerun: yes;"> </span><span style="color: green;">//if it’s not
been modified return the current string</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span> Field.FieldRenderingControl.ItemFieldValue;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: blue;">set</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">try</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>EnsureChildControls();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(!<span style="color: blue;">value</span>.ToString().Equals(<span style="color: #a31515;">","</span>) || !<span style="color: blue;">value</span>.ToString().Equals(<span style="color: #a31515;">""</span>))<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">// Setting the Image
thumbnail url to the Image control added earlier</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>ImgThumb.ImageUrl = <span style="color: blue;">value</span>.ToString().Substring(<span style="color: blue;">value</span>.ToString().IndexOf(<span style="color: #a31515;">','</span>) + 1);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">//Setting the Image
control and Delete button control visible in Edit Form if value exists</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>ImgThumb.Visible = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>btnDelete.Visible = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>ImgThumb.Visible = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>btnDelete.Visible = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">catch</span>
{ }<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoListParagraph" style="margin: 0in 0in 10pt 0.5in; mso-list: l5 level1 lfo8; text-indent: -0.25in;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri;">3.</span><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: Calibri;">Now define the control how
should it behave in <b style="mso-bidi-font-weight: normal;">New Form, Display
Form and Edit Form</b> of List Item [Check the inline comments for
description].<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">protected</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">override</span>
<span style="color: blue;">void</span> CreateChildControls()<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">try</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(Field == <span style="color: blue;">null</span>) <span style="color: blue;">return</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">base</span>.CreateChildControls();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(ControlMode == Microsoft.SharePoint.WebControls.<span style="color: #2b91af;">SPControlMode</span>.Display)
<span style="color: blue;">return</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(ControlMode == <span style="color: #2b91af;">SPControlMode</span>.New ||
ControlMode == <span style="color: #2b91af;">SPControlMode</span>.Edit)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">Stream</span>
fs = <span style="color: blue;">null</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">// As we set the
Default Template name to the name of SharePoint rendering template name
defined in ascx file.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">// Now get the
instance all the controls from the TemplateContanier.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload = (<span style="color: #2b91af;">FileUpload</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"flUpload"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage = (<span style="color: #2b91af;">Label</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"lblMessage"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>lblMessage2 = (<span style="color: #2b91af;">Label</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"lblMessage2"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage3 = (<span style="color: #2b91af;">Label</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"lblMessage3"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>ImgThumb = (<span style="color: #2b91af;">Image</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"ImgThumb"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>btnDelete = (<span style="color: #2b91af;">Button</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"btnDelete"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>txtValue = (<span style="color: #2b91af;">TextBox</span>)TemplateContainer.FindControl(<span style="color: #a31515;">"txtValue"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>btnDelete.Click += <span style="color: blue;">new</span> <span style="color: #2b91af;">EventHandler</span>(btnDelete_Click);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">try</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: #2b91af;">SPContext</span>.Current.Item[Field.Title].Equals(<span style="color: #a31515;">"null"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">catch</span>
(<span style="color: #2b91af;">Exception</span> E)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>ImgThumb.Visible = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>btnDelete.Visible = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">// Checking
whether the File upload control has any file<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(flUpload.HasFile)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//Checking the
File Content Length</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (flUpload.PostedFile.ContentLength <= 524288)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>fs =
flUpload.PostedFile.InputStream;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>filename =
flUpload.FileName;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>hasfile = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.EnableViewState
= <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload =
filenull;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>flUpload.Dispose();<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.Enabled
= <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>fileSize = 0;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//TemplateContainer.fin</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>hasfile = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>fileSize = 1;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">return</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.TabIndex =
TabIndex;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.CssClass =
CssClass;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.ToolTip =
Field.Title + <span style="color: #a31515;">" Image"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">// Checking the
Default Image library is defined or not. We can define the library in List
settings.</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>System.Collections.Specialized.<span style="color: #2b91af;">NameValueCollection</span>
PictureLibrarys;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>PictureLibrarys = <span style="color: #2b91af;">SharepointInformation</span>.QueryCustType(<span style="color: #2b91af;">SPContext</span>.Current.Web.Url.ToString(), <span style="color: #2b91af;">SPEncode</span>.UrlDecodeAsUrl(<span style="color: #2b91af;">SPContext</span>.Current.List.ToString()),
<span style="color: #a31515;">"CustomImageStorage"</span>, <span style="color: #a31515;">"ImageEnhancerCustomField"</span>,Field.Title);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(PictureLibrarys[0].Equals(<span style="color: #a31515;">"False"</span>))<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.Enabled = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage.Text = <span style="color: #a31515;">"Image cannot be uploaded as no Picture Library is
associated with this list. In order to setup Picture Library, go to "</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage2.Text = <span style="color: #a31515;">"'List Settings - General Settings - Enhanced Image
/ Document Library' "</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage3.Text = <span style="color: #a31515;">"and select existing Picture Library"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//lblMessage3.ForeColor = "Red";</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//lblMessage.ForeColor = "Red";</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//lblMessage2.ForeColor = "Red";</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage.Font.Bold
= <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage2.Font.Bold
= <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>lblMessage3.Font.Bold
= <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>lblMessage2.Font.Italic = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>flUpload.Enabled = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (lblMessage != <span style="color: blue;">null</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span>lblMessage.Visible = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: green;">//IF
THE UPLOAD FIELD HAS INFORMATION </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(hasfile)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">bool</span> exist = <span style="color: blue;">false</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (PictureLibrarys.HasKeys())<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="color: blue;">for</span> (<span style="color: blue;">int</span> i = 0; i < PictureLibrarys.Count; i++)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span>
(PictureLibrarys.GetKey(i).Equals(Field.InternalName) ||
PictureLibrarys.GetKey(i).Equals(Field.Title))<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span>exist = <span style="color: blue;">true</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">break</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">if</span> (exist)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">// Uploads the
File to the SharePoint Image library defined in the List settings if File
exist.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>thumbnailpath = <span style="color: #2b91af;">SharepointInformation</span>.UploadImage(<span style="color: #2b91af;">SPContext</span>.Current.Web.Url.ToString(), fs,
PictureLibrarys[Field.Title], <span style="color: #a31515;">""</span>,
filename, <span style="color: #2b91af;">SPContext</span>.Current.Web);<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>httppath = <span style="color: #2b91af;">SPContext</span>.Current.Web.Lists[PictureLibrarys[Field.Title]].ParentWebUrl.ToString()
+ <span style="color: #a31515;">"/"</span> + <span style="color: #2b91af;">SPContext</span>.Current.Web.Lists[PictureLibrarys[Field.Title]].RootFolder.Url
+ <span style="color: #a31515;">"/"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>thumbnailpath = <span style="color: #a31515;">"Go to List Settings - Enhanced Image
Settings"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">catch</span>
(<span style="color: #2b91af;">Exception</span> spe)<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>{<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><span style="color: blue;">int</span>
i = 0;<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
</td>
</tr>
</tbody></table>
<br />
<h3 style="margin: 10pt 0in 0pt;">
<span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Creating Field type Deployment file [<span style="font-weight: normal; mso-bidi-font-weight: bold;">fldtypes_ImageEnhancer.xml</span>]<o:p></o:p></span></span></span></h3>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Open <b style="mso-bidi-font-weight: normal;">fldtypes_ImageEnhancer.xml
</b>file and copy the below code [Check the inline comments for description]. <o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><?</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">xml</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">version</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">1.0</span>"<span style="color: blue;"> </span><span style="color: red;">encoding</span><span style="color: blue;">=</span>"<span style="color: blue;">utf-8</span>"<span style="color: blue;">?></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">FieldTypes</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">FieldType</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//Define the Field
Type Name here<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">TypeName</span>"<span style="color: blue;">></span>ImageEnhancerCustomField<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//Define the
Parent Type from the new type is getting Inherited</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ParentType</span>"<span style="color: blue;">></span>Text<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//Provide the
Display name for the Field</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">TypeDisplayName</span>"<span style="color: blue;">></span>Enhanced Image<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">TypeShortDescription</span>"<span style="color: blue;">></span>Enhanced Image<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">UserCreatable</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//Specify where
all this column should be available</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ShowInListCreate</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ShowInSurveyCreate</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ShowInDocumentLibrary</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ShowInColumnTemplateCreate</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">Sortable</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">Filterable</span>"<span style="color: blue;">></span>TRUE<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">// Specify the
NameSpace and class details where the implementation is done</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">FieldTypeClass</span>"<span style="color: blue;">></span>EnhancedPicture.ImageEnhancerCustomField,
EnhancedPicture, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=b5ecf5690ed59344<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Field</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">SQLType</span>"<span style="color: blue;">></span>nvarchar<span style="color: blue;"></</span><span style="color: #a31515;">Field</span><span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: #00b050; font-family: Consolas; font-size: 9.5pt;">//Below part is to
define how the field should appear in Display Form</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">RenderPattern</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">DisplayPattern</span>"<span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Switch</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Expr</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Column</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> /></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Expr</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Case</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Value</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">""<span style="color: blue;"> /></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Default</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">HTML</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><![CDATA[</span><span style="color: grey; font-family: Consolas; font-size: 9.5pt;"><SCRIPT><span style="mso-spacerun: yes;"> </span>function PopupPic(sPicURL) { window.open(
"/_layouts/EnhancedPicture/popup.aspx?"+sPicURL, "",
"HEIGHT=50,WIDTH=50"); }<span style="mso-spacerun: yes;"> </span>var
path='</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">]]></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">HTML</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><span style="mso-tab-count: 5;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Column</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">/></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">HTML</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 6;"> </span><![CDATA[</span><span style="color: grey; font-family: Consolas; font-size: 9.5pt;">'; if (path !=
"," || path != "" || path != " ") {var
xsep=path.lastIndexOf(','); var lastind=path.length;<span style="mso-tab-count: 3;"> </span><span style="mso-tab-count: 3;"> </span>document.write("<a
href=\"javascript:PopupPic('" + path.substring(0,xsep) +
"')\"><span style="mso-tab-count: 6;"> </span><IMG
border=0 SRC='"+ path.substring(xsep+1,lastind)+"' ALT='" + <span style="mso-tab-count: 5;"> </span><span style="mso-tab-count: 1;"> </span>path.substring(xsep+1,lastind) +
"' > </a>");}</SCRIPT></span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">]]></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 5;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">HTML</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><span style="mso-tab-count: 2;"> </span></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 4;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Default</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 3;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Switch</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 2;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">RenderPattern</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">FieldType</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">FieldTypes</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><o:p></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p><span style="font-family: Calibri;">Once we deploy the <b style="mso-bidi-font-weight: normal;">XML</b>
file, we can see the New Field Type in Create Column of the List.<b style="mso-bidi-font-weight: normal;"><o:p></o:p></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhksZkYXUEvTq9vdzqgWtOurzepUrjCQkvS4HcRS_6zLdtcMd5eKmDXuoohoH0FSSBJpOo20ZOgPCuSnjA8MFUGKSCYiwL2DhlyEp5eK4BBz31B20ym7g_hyphenhyphen0e4nxqiaiIebjhJMn295u8D/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="422" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhksZkYXUEvTq9vdzqgWtOurzepUrjCQkvS4HcRS_6zLdtcMd5eKmDXuoohoH0FSSBJpOo20ZOgPCuSnjA8MFUGKSCYiwL2DhlyEp5eK4BBz31B20ym7g_hyphenhyphen0e4nxqiaiIebjhJMn295u8D/s640/1.png" width="640" /></a></div>
<span style="mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><span style="font-family: Calibri;"><v:stroke joinstyle="miter"><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit"></o:lock></v:path></v:stroke></span></v:shapetype></span><br />
<h4 style="margin: 10pt 0in 0pt;">
<em><span style="color: #4f81bd;"><span style="font-family: Cambria;">Configuring Image/Document Library:<o:p></o:p></span></span></em></h4>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">To configure the default <b style="mso-bidi-font-weight: normal;">Image/Document</b> library where the Images and Documents needs to be
uploaded, Navigate to <b style="mso-bidi-font-weight: normal;">List Settings</b> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;"> <b style="mso-bidi-font-weight: normal;">Enhanced Image / Document Library</b>.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWMiG63j0vkvfhmDVlQ5cF3L0DAfj4n1DJuYE2tV-OO7tutVM1YujOnDwFj8g8CgZZ3fRKs9_q8yz_l-nXUfI6dv_TPoXi2A9iDQJeXsstnVEnpcVHMKKscQ9K3VxfltAizfp_blK-B96n/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWMiG63j0vkvfhmDVlQ5cF3L0DAfj4n1DJuYE2tV-OO7tutVM1YujOnDwFj8g8CgZZ3fRKs9_q8yz_l-nXUfI6dv_TPoXi2A9iDQJeXsstnVEnpcVHMKKscQ9K3VxfltAizfp_blK-B96n/s640/2.png" width="640" /></a></div>
<span style="mso-no-proof: yes;"><v:shape id="Picture_x0020_2" o:spid="_x0000_i1034" style="height: 310.5pt; mso-wrap-style: square; visibility: visible; width: 461.25pt;" type="#_x0000_t75"><span style="font-family: Calibri;"><v:imagedata o:title="" src="file:///C:\Users\DINESH~1.NAT\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png"></v:imagedata></span></v:shape></span><o:p></o:p><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Select the Image and Library from the dropdown and Click <b style="mso-bidi-font-weight: normal;">Accept</b> button. Once the <b style="mso-bidi-font-weight: normal;">Accept</b> button is clicked we are
updating <b style="mso-bidi-font-weight: normal;">Fields XML</b> of this current
list with the selected libraries.<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRLoLLpvsSaRYB5_3iGaurpNsvg-nxp6Ekh4cMq6EBKWE5ddbtZzyvBzf-i8q_ZJi04uWg0auM76FaTRsad_oplwLrGVaMhhcG98Ng2PmAtFjkF-wmd6MXHNidYnap-xiIqamGrdo5ojW8/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRLoLLpvsSaRYB5_3iGaurpNsvg-nxp6Ekh4cMq6EBKWE5ddbtZzyvBzf-i8q_ZJi04uWg0auM76FaTRsad_oplwLrGVaMhhcG98Ng2PmAtFjkF-wmd6MXHNidYnap-xiIqamGrdo5ojW8/s640/3.png" width="640" /></a></div>
<o:p><span style="font-family: Calibri;"></span></o:p><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">To Add a link under <b style="mso-bidi-font-weight: normal;">General
Settings</b> in <b style="mso-bidi-font-weight: normal;">List settings</b> page
deploy the below Elements.xml.<o:p></o:p></span></div>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt; width: 6.65in;" valign="top" width="638"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><?</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">xml</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">version</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">1.0</span>"<span style="color: blue;"> </span><span style="color: red;">encoding</span><span style="color: blue;">=</span>"<span style="color: blue;">utf-8</span>"<span style="color: blue;">?></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Elements</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">xmlns</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">http://schemas.microsoft.com/sharepoint/</span>"<span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">CustomAction</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Id</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ImageEnhacer</span>"<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">GroupId</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">GeneralSettings</span>"<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Location</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">Microsoft.SharePoint.ListEdit</span>"<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Sequence</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">20</span>"<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Title</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">Enhanced Image /
Document Library</span>"<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span></span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">RequireSiteAdministrator</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">TRUE</span>"<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span>></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">UrlAction</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">Url</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">~site/_layouts/EnhancedPicture/PicturePicker.aspx?</span><span style="color: red;">&amp;</span><span style="color: blue;">siteId={SiteUrl}</span><span style="color: red;">&amp;</span><span style="color: blue;">listId={ListId}</span><span style="color: red;">&amp;</span><span style="color: blue;">itemId={ItemId}</span>"<span style="color: blue;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">CustomAction</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">Elements</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
</div>
</td>
</tr>
</tbody></table>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p><em><span style="color: #4f81bd;"><span style="font-family: Cambria;">New Item Form<o:p></o:p></span></span></em></div>
<span style="font-family: Calibri;">In <b style="mso-bidi-font-weight: normal;">New Item form</b>
we can browse through the file which needs to be uploaded and click on the <b style="mso-bidi-font-weight: normal;">Save</b> button.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirHybZ95LEFLsbgzmkFk59SW-Bmmn4_J-YglyzHn4Yd_kJGUTpARMYTeMc_ZOYBmduhdcGIoIazkCosy2M1LHxCioN-RWZccIMiNT6iAHCwAiM6syaxMu4HmKnq_sFAi-yy9JoAMPQnKaU/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirHybZ95LEFLsbgzmkFk59SW-Bmmn4_J-YglyzHn4Yd_kJGUTpARMYTeMc_ZOYBmduhdcGIoIazkCosy2M1LHxCioN-RWZccIMiNT6iAHCwAiM6syaxMu4HmKnq_sFAi-yy9JoAMPQnKaU/s400/4.png" width="397" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrW2k0zKtQQRXFjUTtsexV6KFVI82ArY32iWqZgXqHox7uyS8FnbxQllWyyTdUAtQpUUDKZccQA6YN5v4FVtq3Ar_maclCGBpD7JjxSbKKcATSR7Hm0PD6DJZiEzCcRwaNdf8fBZX-ocKY/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrW2k0zKtQQRXFjUTtsexV6KFVI82ArY32iWqZgXqHox7uyS8FnbxQllWyyTdUAtQpUUDKZccQA6YN5v4FVtq3Ar_maclCGBpD7JjxSbKKcATSR7Hm0PD6DJZiEzCcRwaNdf8fBZX-ocKY/s400/1.png" width="396" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Once the Item is <b style="mso-bidi-font-weight: normal;">saved</b>,
selected document will be uploaded to the respective library and these New
Columns will have a <b style="mso-bidi-font-weight: normal;">reference</b> to the
<b style="mso-bidi-font-weight: normal;">Document / Image</b>.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA7VFj691nUoFjutmFUk5hLeebugJ-BNgYb_N3ldcovz2QHdvqRVCyE2yK2rZidEzCTqDmB6H8dINgyMmH4ECBqDotX7PomkyhIi7cKsrOgPDqlnb_eHr_k0nb4ODZKrsps4_fs_AolKqQ/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA7VFj691nUoFjutmFUk5hLeebugJ-BNgYb_N3ldcovz2QHdvqRVCyE2yK2rZidEzCTqDmB6H8dINgyMmH4ECBqDotX7PomkyhIi7cKsrOgPDqlnb_eHr_k0nb4ODZKrsps4_fs_AolKqQ/s640/2.png" width="640" /></a></div>
<span style="mso-no-proof: yes;"><v:shape id="Picture_x0020_6" o:spid="_x0000_i1030" style="height: 116.25pt; mso-wrap-style: square; visibility: visible; width: 467.25pt;" type="#_x0000_t75"><span style="font-family: Calibri;"></span></v:shape></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">Navigate to the <b style="mso-bidi-font-weight: normal;">Libraries
selected</b> in <b style="mso-bidi-font-weight: normal;">settings</b> page to
verify the <b style="mso-bidi-font-weight: normal;">uploaded Document / Image</b>.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVQGyC78vTODRIzEttV_J9RCpY47nffWRTB10gdJ_l5g-DN_bgmODwBuSAEmndHEB5nAlDzocda1ieVur3zL84fXbVtrhKRXwIu94l1mtFsFETeiINSi1B-6PHRiOaw7iuZ9aRnut1FTl0/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="218" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVQGyC78vTODRIzEttV_J9RCpY47nffWRTB10gdJ_l5g-DN_bgmODwBuSAEmndHEB5nAlDzocda1ieVur3zL84fXbVtrhKRXwIu94l1mtFsFETeiINSi1B-6PHRiOaw7iuZ9aRnut1FTl0/s640/7.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV7QmOQVSejrugY7Cu3IjGBcqeIjzZtWAeIivh6_a_Urx86dWZtrwA78jcygBZSh44fGznuvF2ckjoU9cjJMblxw3GfY4WkROnv8WFVyHfDmhDGSULDwtO2iFV2YRGkeIclZYsNoTMuHnj/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV7QmOQVSejrugY7Cu3IjGBcqeIjzZtWAeIivh6_a_Urx86dWZtrwA78jcygBZSh44fGznuvF2ckjoU9cjJMblxw3GfY4WkROnv8WFVyHfDmhDGSULDwtO2iFV2YRGkeIclZYsNoTMuHnj/s640/3.png" width="640" /></a></div>
<br />
<o:p><span style="font-family: Calibri;"></span></o:p><br />
<o:p></o:p><em><span style="color: #4f81bd;"><span style="font-family: Cambria;">View Item Form<o:p></o:p></span></span></em><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">In the View Item Form, we can see the <b style="mso-bidi-font-weight: normal;">Thumbnail</b> <b style="mso-bidi-font-weight: normal;">image</b> for the <b style="mso-bidi-font-weight: normal;">Image field</b> <b style="mso-bidi-font-weight: normal;">type</b> and a <b style="mso-bidi-font-weight: normal;">Link</b> to the
document for <b style="mso-bidi-font-weight: normal;">Hyperlink field type</b>. </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXoH1cWtVvpUAsJEnMrlKfdtLeJWpx7-EphuyF6DXAgoBhjO0UFp73X-pQSZN_76FHA1PHDG27TBkyAHB9IsHPkjh90YRmqqbMiFoe9cDWkDxAODL-HTnK_QlDG5A0tPnHcxiVlC7Ugz_p/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="635" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXoH1cWtVvpUAsJEnMrlKfdtLeJWpx7-EphuyF6DXAgoBhjO0UFp73X-pQSZN_76FHA1PHDG27TBkyAHB9IsHPkjh90YRmqqbMiFoe9cDWkDxAODL-HTnK_QlDG5A0tPnHcxiVlC7Ugz_p/s640/9.png" width="640" /></a></div>
<br />
<span style="font-family: Calibri;"></span><br />
<span style="font-family: Calibri;">Once clicking on the <b style="mso-bidi-font-weight: normal;">thumbnail</b>,
we can see the <b style="mso-bidi-font-weight: normal;">Full Image</b>. Upon
clicking on the <b style="mso-bidi-font-weight: normal;">link</b>, document will
be <b style="mso-bidi-font-weight: normal;">downloaded</b>.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1K-DpeuyS9r5lM_LaCJSgqaMY5ZIhTqi5-8jKp-hwUCYs9llUZT-fUafDFiBvmqRYy_NArXyscwnLVKfDSfeJD801CDIB23xts1Zv2abIKQ3gnhODRMv4ncHKKUH17jrI-Pk5dsmmMbXN/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="311" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1K-DpeuyS9r5lM_LaCJSgqaMY5ZIhTqi5-8jKp-hwUCYs9llUZT-fUafDFiBvmqRYy_NArXyscwnLVKfDSfeJD801CDIB23xts1Zv2abIKQ3gnhODRMv4ncHKKUH17jrI-Pk5dsmmMbXN/s400/10.png" width="400" /></a></div>
</div>
<em><span style="color: #4f81bd;"><span style="font-family: Cambria;">Edit Item Form<o:p></o:p></span></span></em><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">In <b style="mso-bidi-font-weight: normal;">Edit Item Form</b>,
we can change the <b style="mso-bidi-font-weight: normal;">Document/Image
reference</b> by clicking the <b style="mso-bidi-font-weight: normal;">Delete</b>
button, which will remove the reference and we can upload a new Item.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfwQwMRhjQjIUVHIznliHkSo09j08wylZzTmq2IqogA0ruVa879sKVhJ5a6U8OEAKpVyzUlt0MXs1wTxdzY-P4Xatqr12a5BAd38xVK7XO6I_IwIUeTb65wMVQDnSKUqiVPJb5f-1yQea6/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfwQwMRhjQjIUVHIznliHkSo09j08wylZzTmq2IqogA0ruVa879sKVhJ5a6U8OEAKpVyzUlt0MXs1wTxdzY-P4Xatqr12a5BAd38xVK7XO6I_IwIUeTb65wMVQDnSKUqiVPJb5f-1yQea6/s640/11.png" width="514" /></a></div>
<span style="mso-no-proof: yes;"><v:shape id="Picture_x0020_8" o:spid="_x0000_i1025" style="height: 582.75pt; mso-wrap-style: square; visibility: visible; width: 468pt;" type="#_x0000_t75"><span style="font-family: Calibri;">
<v:imagedata o:title="" src="file:///C:\Users\DINESH~1.NAT\AppData\Local\Temp\msohtmlclip1\01\clip_image021.png">
</v:imagedata></span></v:shape></span><o:p></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-21417264064097890282013-08-14T08:59:00.000-07:002013-08-18T12:17:49.449-07:00Configure Forms Based Authentication in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="margin: 10pt 0in 0pt;">
<span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Configure Forms Based Authentication with Active Directory Membership
Provider </span></span></span></h2>
<div class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: justify; text-indent: 9pt;">
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span><br /></div>
<div class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: justify; text-indent: 9pt;">
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">In SharePoint 2010 for a
web application we can enable both <span style="color: #cc0000;"><b style="mso-bidi-font-weight: normal;">windows</b>,
<b style="mso-bidi-font-weight: normal;">forms</b> <b style="mso-bidi-font-weight: normal;">authentication</b></span>. In earlier implementation to do this, we have to
create two web applications which has different zones and different
authentication. But, with the new claims based authentication a single
application can have the capability to configure both windows and forms under
single URL. All this is possible because of the authentication framework is
built on Microsoft Identify Foundation. Below steps describes the
implementation of <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">FBA</span></b> with <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Active Directory Membership Provider in
SharePoint 2010</span></b>.</span><span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><o:p> </o:p></span></span></div>
<div class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: justify; text-indent: 9pt;">
<ul>
<li><div class="MsoListParagraph" style="margin: 0in 0in 0pt 45pt; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -0.25in;">
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Create a new web application with<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Claims Based authentication</b></span> enabled.</span></span></div>
</li>
<li><div class="MsoListParagraph" style="margin: 0in 0in 0pt 45pt; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -0.25in;">
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Adding Configuration information to web.config in <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Central admin</span></b>, our <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">new web app</span></b>, and in the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">STS web service</span></b></span></div>
</li>
<li><div class="MsoListParagraph" style="margin: 0in 0in 0pt 45pt; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -0.25in;">
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Add a User Policy to our web app that will grant an FBA user rights to the site</span></span></div>
</li>
<li><div class="MsoListParagraph" style="margin: 0in 0in 0pt 45pt; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -0.25in;">
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Login to the site and check.</span></span></div>
</li>
</ul>
</div>
<br />
<br />
<strong><em><span style="color: #0b5394;">Create a New Web Application</span></em></strong><span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span><br />
<span style="color: black; font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">
</span>
<span style="font-family: Calibri;"><span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;">To Start-with, Open <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Central Administration</span></b> web site and Navigate to<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Manage Web Applications</b></span>, and then click
on the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">new button</span></b> in the ribbon to
create a new web application. <o:p></o:p></span></span><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<span style="mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">In the Authentication mode, select <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Claims Based Authentication</span>.</b><o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<span style="font-family: "Times New Roman","serif"; mso-fareast-font-family: "Times New Roman"; mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas></v:stroke></v:shapetype></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj10PpAsVmtv8SJo874tyV7olE4VnNh7kG0upmiBASe8rKfuxmwAJNYWZCRAXZc0dcHuW93yjZzG5qfcqPT9XW4W9aqoT8vbqAh2CTjKVywrAAN26T6fzUGM17PhrijXw8FUnGmUYe5xb1j/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj10PpAsVmtv8SJo874tyV7olE4VnNh7kG0upmiBASe8rKfuxmwAJNYWZCRAXZc0dcHuW93yjZzG5qfcqPT9XW4W9aqoT8vbqAh2CTjKVywrAAN26T6fzUGM17PhrijXw8FUnGmUYe5xb1j/s640/1.png" width="530" /></a></div>
<br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Once we select the authentication mode to be
claims,<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Windows Authentication</b></span> is
also plugged in as one of the provider in<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Identity
Providers</b></span>. Check the “<b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Enable
Windows Authentication</span></b>” check box if you’d like Windows Authentication ALSO
enabled for this web application.<o:p></o:p></span></span><br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">
<br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">We can also choose to enable ASP.NET
Membership and Role Provider here. In this case, we’ll need to provide
the corresponding provider names in the text boxes. The web.config file
entries can be added later.</span></span><br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78dRx14AEXy17iKfO1uxY0T2C82Of_P74zyclGBLVLrXFtufDSdfOwyhdUJHsXqkOElQJJVp_lZzYVRpjBP6PAdmgwjkIe0gR37rZTd0IOx7snXOEe6U983v3_gVtLLavtYRbid5bQanN/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78dRx14AEXy17iKfO1uxY0T2C82Of_P74zyclGBLVLrXFtufDSdfOwyhdUJHsXqkOElQJJVp_lZzYVRpjBP6PAdmgwjkIe0gR37rZTd0IOx7snXOEe6U983v3_gVtLLavtYRbid5bQanN/s640/2.png" width="452" /></a></div>
<br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-no-proof: yes;"></span><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><o:p></o:p></span><br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Once you fill the other details click Ok to
create a new web application and also create a top level site collection.</span><br />
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><o:p></o:p></span><br />
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<b><i><span style="color: #4f81bd; font-family: "Cambria","serif"; font-size: 12pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="color: #0b5394;">Adding Configuration
information to web.config<o:p></o:p></span></span></i></b></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">Basically we need
to modify 3 web.config files for enabling claims:<o:p></o:p></span></span></div>
<ol start="1" type="1">
<li class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">The config file of the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Central Administration</span></b> site. <o:p></o:p></span></span></li>
<li class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">The config file of the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Web Application</span></b>. <o:p></o:p></span></span></li>
<li class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">The config file of the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">STS (SecurityTokenService) Application</span></b>.
This is important because it is this service that will ensure claims
tokens are being passed correctly between the provider (in our case AD)
and the consumer (CA and our Web Application).<o:p></o:p></span></span></li>
</ol>
<ul style="text-align: left;">
<li><div class="MsoListParagraph" style="margin: 1em 0in 1em 22.5pt; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Open the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">web.config of
Central Administration</span></b> and add the following entries.<o:p></o:p></span></div>
</li>
</ul>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Connection
String</span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">: Make sure the below marked line (in yellow) to change as per
your domain name.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">connectionStrings</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">connectionString</span><span style="color: blue;">=</span><span style="background: yellow; color: blue; mso-highlight: yellow;"><a href="ldap://XXXXXXXX/DC=XXXXX,DC=XXXXX">LDAP://XXXXXXXX/DC=XXXXX,DC=XXXXX</a></span><span style="color: blue;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">connectionStrings</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><o:p></o:p></span><br />
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">Provider
Entry:<o:p></o:p></span></span></b></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">membership</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">defaultProvider</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADMembers</span>"<span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">providers</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADMembers</span>"<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>"<span style="color: blue;">System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</span>"<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">enableSearchMethods</span><span style="color: blue;">=</span>"<span style="color: blue;">true</span>"<span style="color: blue;"> </span><span style="color: red;">attributeMapUsername</span><span style="color: blue;">=</span>"<span style="color: blue;">sAMAccountname</span>"<span style="color: blue;"> /><span style="mso-spacerun: yes;"> </span></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">providers</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">membership</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><br />
<br />
<br />
<strong><span style="font-family: Calibri;">People Picker Entry:</span></strong></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="color: black; font-family: Times New Roman; font-size: small;">
</span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="font-size: small;"><span style="color: black;"><span style="font-family: Calibri;">Add the below line between <span style="color: #e06666;"><span style="color: #cc0000;"><PeoplePickerWildcards></PeoplePickerWildcards</span>></span>
for the People picker to include the FBA users in the search results.</span></span></span></span></div>
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">
</span>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">add</span><span style="color: black; font-family: "Times New Roman","serif"; font-size: 12pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">key</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">="ADmembers"</span><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">value</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">="</span><span style="color: black; font-family: "Times New Roman","serif"; font-size: 12pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">*</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">" /></span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
</div>
</div>
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Note: </span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">The
connection string element should be present outside of the
<system.web></system.web> section and the provider element should
be present within <system.web></system.web> section of the
web.config file.</span><span style="font-size: 12pt; line-height: 115%; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></div>
</div>
<ul style="text-align: left;">
<li><div class="MsoListParagraph" style="margin: 1em 0in 1em 22.5pt; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Open the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">web.config of
newly created WebApplication</span></b> and add the following entries<o:p></o:p></span></div>
</li>
</ul>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Connection
String</span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">:</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></span><br />
<span style="font-family: Calibri;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><br /></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> <</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">connectionStrings</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">connectionString</span><span style="color: blue;">=</span>"<span style="background: yellow; color: blue; mso-highlight: yellow;"><a href="ldap://XXXXXXXX/DC=XXXXX,DC=XXXXX">LDAP://XXXXXXXX/DC=XXXXX,DC=XXXXX</a><span style="color: blue;"></span></span>"<span style="color: blue;"> /></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">connectionStrings</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span><br />
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Provider
Entry: </span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Add this entry below the default entry which will be already exist
under membership provider<b style="mso-bidi-font-weight: normal;"><o:p></o:p></b></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADMembers</span>"<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>"<span style="color: blue;">System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</span>"<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">enableSearchMethods</span><span style="color: blue;">=</span>"<span style="color: blue;">true</span>"<span style="color: blue;"> </span><span style="color: red;">attributeMapUsername</span><span style="color: blue;">=</span>"<span style="color: blue;">sAMAccountname</span>"<span style="color: blue;"> /></span><o:p></o:p></span><br />
<span style="font-family: Consolas; font-size: 9.5pt;"><span style="color: blue;"><br /></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">After adding It should be something like below snippet.<o:p></o:p></span></span><br />
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><br /></span>
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">membership</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">defaultProvider</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">i</span>"<span style="color: blue;">></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">providers</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">i</span>"<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>"<span style="color: blue;">Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider,
Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c</span>"<span style="color: blue;"> /></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADMembers</span>"<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>"<span style="color: blue;">System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</span>"<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">enableSearchMethods</span><span style="color: blue;">=</span>"<span style="color: blue;">true</span>"<span style="color: blue;"> </span><span style="color: red;">attributeMapUsername</span><span style="color: blue;">=</span>"<span style="color: blue;">sAMAccountname</span>"<span style="color: blue;"> /><span style="mso-spacerun: yes;"> </span></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">providers</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">membership</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span></span><br />
<span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><br />
<span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"></span></span></span><br /></div>
<span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"><span style="font-family: Calibri;"><strong>People Picker Entry:</strong></span></span></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="font-size: small;"><span style="color: black;"><span style="font-family: Calibri;">Add the below line between <span style="color: #e06666;"><span style="color: #cc0000;"><PeoplePickerWildcards></PeoplePickerWildcards</span>></span>for the People picker to include the FBA users in the search results.</span></span></span></span></span></span></span><span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"> <</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">add</span><span style="color: black; font-family: "Times New Roman","serif"; font-size: 12pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">key</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">="ADmembers"</span><span style="color: red; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">value</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">="</span><span style="color: black; font-family: "Times New Roman","serif"; font-size: 12pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">*</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">" /></span></span></span></span><br />
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="font-family: Symbol; font-size: 11pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Open the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">web.config of STS
web service</span></b> and add the following entries, to find the web.config Open IIS
and navigate <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">SecurityTokenServiceApplication</span></b>
and click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Explore</span></b> in the Right pane.</span></span></div>
</div>
<div class="MsoListParagraph" style="margin: 1em 0in 1em 22.5pt; mso-list: l1 level1 lfo3; text-indent: -0.25in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiOJEKkvKzfa68fIbNhSeR4d_lLwxRRCQW2oMwH5UZkCHtpgOiMY0iGCpBWSllrqAdop-L8CHfpNC3AeSePeVGz9lk7OPIAJo1ok27jAS6S6MG0yNKU9c-UUPagojTUayZLBxVWW_JnIMg/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiOJEKkvKzfa68fIbNhSeR4d_lLwxRRCQW2oMwH5UZkCHtpgOiMY0iGCpBWSllrqAdop-L8CHfpNC3AeSePeVGz9lk7OPIAJo1ok27jAS6S6MG0yNKU9c-UUPagojTUayZLBxVWW_JnIMg/s1600/3.png" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span><br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Connection
String</span></b><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">:</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></span><br />
<span style="font-family: Calibri;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><br /></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">connectionStrings</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">connectionString</span><span style="color: blue;">=</span>"<span style="background: yellow; color: blue; mso-highlight: yellow;"><a href="ldap://XXXXXXXX/DC=XXXXX,DC=XXXXX">LDAP://XXXXXXXX/DC=XXXXX,DC=XXXXX</a>"<span style="color: blue;"></span></span><span style="color: blue;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">connectionStrings</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><o:p></o:p></span><br />
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Provider
Entry:</span></b><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></span><br />
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><br /></span></b></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">system.web</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">membership</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">defaultProvider</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADMembers</span>"<span style="color: blue;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">providers</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;">
</span><</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">add</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> </span><span style="color: red; font-family: Consolas; font-size: 9.5pt;">name</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">=</span><span style="font-family: Consolas; font-size: 9.5pt;">"<span style="color: blue;">ADMembers</span>"<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>"<span style="color: blue;">System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</span>"<span style="color: blue;"> </span><span style="color: red;">connectionStringName</span><span style="color: blue;">=</span>"<span style="color: blue;">ADConnection</span>"<span style="color: blue;"> </span><span style="color: red;">enableSearchMethods</span><span style="color: blue;">=</span>"<span style="color: blue;">true</span>"<span style="color: blue;"> </span><span style="color: red;">attributeMapUsername</span><span style="color: blue;">=</span>"<span style="color: blue;">sAMAccountname</span>"<span style="color: blue;"> /><span style="mso-spacerun: yes;"> </span></span><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">providers</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">membership</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">></span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"></</span><span style="color: #a31515; font-family: Consolas; font-size: 9.5pt;">system.web</span><span style="color: blue; font-family: Consolas; font-size: 9.5pt;">><o:p></o:p></span><br />
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><br /></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">After doing all these configuration
changes do an <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">iisreset</span></b> to make the
changes effective.</span></span><br />
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;"><br /></span></span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<b><i><span style="color: #4f81bd; font-family: "Cambria","serif"; font-size: 12pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="color: #0b5394;">Grant permissions to FBA
Users.<o:p></o:p></span></span></i></b></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div style="text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">To Specify the Provider name in the
Web application, open <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Central
Administration site</span></b>, Navigate to “<b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Manage
all web applications</span>”</b> and select the respective Web application and click
on the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Authentication Providers</span></b> from
the ribbon and select the Zone from the popup.</span></span></div>
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIt9TKSHpHL8BN9jNfdd9pGonG3JIvgYRxPo9Iyp807x2dSVtVy02th3YdXvKvam8EaoEZyRW5ewUp9wwuyjUY7zflFZVCxxkTzokxWYlNSagIok_lRX4PXbcV0EL6fhDU9wD1T8Qd6pI5/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIt9TKSHpHL8BN9jNfdd9pGonG3JIvgYRxPo9Iyp807x2dSVtVy02th3YdXvKvam8EaoEZyRW5ewUp9wwuyjUY7zflFZVCxxkTzokxWYlNSagIok_lRX4PXbcV0EL6fhDU9wD1T8Qd6pI5/s640/1.png" width="640" /></a></div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span><br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div style="text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">Specify the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Provider name</span></b> and save the changes. Now to grant permissions to FBA
Users select on the<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Web application</b></span>
in central administration and click on the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">User
Policy</span></b> from the ribbon.</span></span></div>
</div>
<div style="text-align: left;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoListParagraph" style="margin: 1em 0in 1em 0.5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo4; text-indent: -0.25in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmCnRysAtQiHaVWVbWMvK7opnq5sMYspFzfxOZDnnUtor1SafJPJAsvT1z45thAGathwXBdrVAIs3WqU3tBaetG3B-RCwWTzVeVa7d89AowlWazBxq2O2uMYAhB5FUyUizVfEWtToipa9/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmCnRysAtQiHaVWVbWMvK7opnq5sMYspFzfxOZDnnUtor1SafJPJAsvT1z45thAGathwXBdrVAIs3WqU3tBaetG3B-RCwWTzVeVa7d89AowlWazBxq2O2uMYAhB5FUyUizVfEWtToipa9/s1600/2.png" /></a></div>
<br />
<ol style="text-align: left;">
<li style="text-align: left;"><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Click on the Add Users link to add new user</span></li>
</ol>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMBw733d-A0VwaLfRiX6cc9rTuHpCI-xKpmZXPJ-tWj_3htW4M-YyEM_hjJoBUfGSYT7C66id2dXUvkMilAnhRafmGM6iZmvCI5p3hyphenhyphendIy8dKLlyb7BEIH2kPt8Hw8ndv4gNaWeVOCi2My/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMBw733d-A0VwaLfRiX6cc9rTuHpCI-xKpmZXPJ-tWj_3htW4M-YyEM_hjJoBUfGSYT7C66id2dXUvkMilAnhRafmGM6iZmvCI5p3hyphenhyphendIy8dKLlyb7BEIH2kPt8Hw8ndv4gNaWeVOCi2My/s400/6.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">2. Select the respective Zone to which the User needs to be added or
select ALL zones and click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Next</span></b>.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8bL-q_NMChsnLEDRvwa97U6E_w1B1Cu9y6-05tNMe9dnwCySDDbHO6bJHVZiGSfIpUbM64DKpv9jqigVtZH8lIIpBJXPfZoJnhyMiMs-AXzKEMlxmbbPOtqaduJoMXfQm9WLUh2EDCKp_/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8bL-q_NMChsnLEDRvwa97U6E_w1B1Cu9y6-05tNMe9dnwCySDDbHO6bJHVZiGSfIpUbM64DKpv9jqigVtZH8lIIpBJXPfZoJnhyMiMs-AXzKEMlxmbbPOtqaduJoMXfQm9WLUh2EDCKp_/s320/7.png" width="320" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span><br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoListParagraph" style="margin: 1em 0in 1em 0.5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo4; text-indent: -0.25in;">
<div style="text-align: left;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";"> 3. </span></span></span><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Here you can see the difference in the Select people and groups
dialog box, where you various section in the left pane. And now if you search
for a User, you can find 2 results for the same user. Select the FBA user from
the result and add to the site.</span></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijr45TY6HTKBFSkK8mJlTqIPl4uzyFts4MUAe1GW1tb6MFb3IkJYDiDeBBLtvGwUD7ENEny5cxDcp5shfbHYJncYr4abjJBFUvC_7J7bt1cqbyreRjQi3Pxzt21Htc3Pua0a-mYdmG-bKI/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijr45TY6HTKBFSkK8mJlTqIPl4uzyFts4MUAe1GW1tb6MFb3IkJYDiDeBBLtvGwUD7ENEny5cxDcp5shfbHYJncYr4abjJBFUvC_7J7bt1cqbyreRjQi3Pxzt21Htc3Pua0a-mYdmG-bKI/s400/8.png" width="368" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoListParagraph" style="margin: 1em 0in 1em 0.5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo4; text-indent: -0.25in;">
<div style="text-align: left;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="mso-list: Ignore;">4.<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Select the respective permissions for the User and click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Finish</span>.</b></span></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><b style="mso-bidi-font-weight: normal;"><br /></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBHLIml9U11qpwXRY2TJcxKkmfOipHvGHlMCf2VgjSGSBm-YAzspj74k5xgnE4Afe9eec_HiqNZUuM6Pd6xefO1Rk2-fSz18suaehm1d1XOP2mwPmzyQvg-l0-1Jl6iAiSxx5y7fqlDT0r/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBHLIml9U11qpwXRY2TJcxKkmfOipHvGHlMCf2VgjSGSBm-YAzspj74k5xgnE4Afe9eec_HiqNZUuM6Pd6xefO1Rk2-fSz18suaehm1d1XOP2mwPmzyQvg-l0-1Jl6iAiSxx5y7fqlDT0r/s400/9.png" width="368" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoListParagraph" style="margin: 1em 0in 1em 0.5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo4; text-indent: -0.25in;">
<div style="text-align: left;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="mso-list: Ignore;">5.<span style="font-size-adjust: none; font-stretch: normal; font: 7pt/normal "Times New Roman";">
</span></span></span><span dir="LTR"></span><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Now you can check the Claim Identity name of the new User here. </span></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjENbZvDyKZhmZ5SRIl9RcwoZzaoAiYkAYoxormvXSbNwEHYGgMLGQcQrGhJyr7yHwg7P2dd_gtNQ4gtiJWkvIQdGlGRvSwql-SGZr-nwQWNrhRrMTZDPdvhq4lET_roiFRoA2_n9Y8uSTi/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjENbZvDyKZhmZ5SRIl9RcwoZzaoAiYkAYoxormvXSbNwEHYGgMLGQcQrGhJyr7yHwg7P2dd_gtNQ4gtiJWkvIQdGlGRvSwql-SGZr-nwQWNrhRrMTZDPdvhq4lET_roiFRoA2_n9Y8uSTi/s1600/3.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoListParagraph" style="margin: 1em 0in 1em 0.5in; mso-layout-grid-align: none; mso-list: l0 level1 lfo4; text-indent: -0.25in;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div style="text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">We can check here how the claims in getting framed; match this
with the above Identity for clear understanding.</span></span></div>
</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxK_Dm7-YK_yolC2AVCiUIRaoV6IbiXWspUDVfJpXdW-oBdAmhGkvEn_9AmTUwWwijBGJwzMol-dg5Jz5w-9TraG9EzvHFJla2vHKxovJ-1vZDC8HvKcPPmFAZla_IsYlfk9RiZq8pVI3X/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxK_Dm7-YK_yolC2AVCiUIRaoV6IbiXWspUDVfJpXdW-oBdAmhGkvEn_9AmTUwWwijBGJwzMol-dg5Jz5w-9TraG9EzvHFJla2vHKxovJ-1vZDC8HvKcPPmFAZla_IsYlfk9RiZq8pVI3X/s640/11.png" width="640" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span><br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;">
<b><i><span style="color: #4f81bd; font-family: "Cambria","serif"; font-size: 12pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="color: #0b5394;">Login to the site:<o:p></o:p></span></span></i></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none; text-align: justify;">
<div style="text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">Now the site is ready to login with <span style="color: #cc0000;"><b style="mso-bidi-font-weight: normal;">Claims based authentication</b>.</span> Navigate
to the newly created site collection which then redirects to the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">default Login screen</span>, </b>where user can
choose between <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Windows Authentication
and Forms Authentication</span></b>.<o:p></o:p></span></span></div>
</div>
<ul style="text-align: left;">
<li><div class="MsoListParagraph" style="margin: 1em 0in 1em 22.5pt; mso-layout-grid-align: none; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -0.25in;">
<div style="text-align: left;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">If we choose Windows authentication, default windows credentials will be used for logging into the site.<o:p></o:p></span></div>
</div>
</li>
<li><div class="MsoListParagraph" style="margin: 1em 0in 1em 22.5pt; mso-layout-grid-align: none; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -0.25in;">
<div style="text-align: left;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">If we choose Forms authentication, user will be prompted for the Credentials.</span></div>
</div>
</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie7LzDHn92vp1aw1PAo57N12xGHi_2ZtrlnyDvaClSlXKFreLptRy-8UN5UJEHDmyNaBUuqB5bVnFTczRNXJ0aBOXXm1dmtMxlNjBzz_BAoAn-REYjQmzQ_Eli_euOue63ROvNCISPSr_e/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie7LzDHn92vp1aw1PAo57N12xGHi_2ZtrlnyDvaClSlXKFreLptRy-8UN5UJEHDmyNaBUuqB5bVnFTczRNXJ0aBOXXm1dmtMxlNjBzz_BAoAn-REYjQmzQ_Eli_euOue63ROvNCISPSr_e/s400/12.png" width="400" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span><br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div style="text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">Select Forms Authentication and it will redirect Forms login
screen, then provide the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">user
credentials</span></b> of the User which we added earlier in User policy.</span></span></div>
</div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFVy0bsz2Tm-W-6qE5c2ZgO_GhEXFF0bBYr5zNg2ww3EPk6L7JLVp_ml731uSKnEZGoLJv2YP-T_9oqPu8hy0qEuYD4dpnHkD9DzzJ5uZd7qDtZlQIUwkFuqInYbPvUu-dkbBWLK9uWHu/s1600/13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYFVy0bsz2Tm-W-6qE5c2ZgO_GhEXFF0bBYr5zNg2ww3EPk6L7JLVp_ml731uSKnEZGoLJv2YP-T_9oqPu8hy0qEuYD4dpnHkD9DzzJ5uZd7qDtZlQIUwkFuqInYbPvUu-dkbBWLK9uWHu/s400/13.png" width="400" /></a></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">
</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<div style="text-align: left;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri;">Now the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">SharePoint 2010</span></b>
site is successfully configured with <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Forms
Based Authentication using Active directory membership provider.</span></b></span></span></div>
</div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"><span style="font-family: Calibri;"></span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"><span style="font-family: Calibri;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"><span style="font-family: Calibri;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWcIu52_qMIIzNyTXrAJvROGGy0wxlDCombhrry7diGYjvEcC-gJiMfQe5HMUCH7jjlsORF8jj9tcutUFkE6vBf-1zUTZoy18JVMUbgYD59A4M3wQvK3jFxoRMWMXDsrCK08IJhHA-nlh8/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWcIu52_qMIIzNyTXrAJvROGGy0wxlDCombhrry7diGYjvEcC-gJiMfQe5HMUCH7jjlsORF8jj9tcutUFkE6vBf-1zUTZoy18JVMUbgYD59A4M3wQvK3jFxoRMWMXDsrCK08IJhHA-nlh8/s400/14.png" width="400" /></a></span></span></div>
</div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;"><span style="font-family: Calibri;">
</span></span>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
</div>
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-no-proof: yes;">
</span>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt; mso-layout-grid-align: none;">
<span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><o:p></o:p></span><br /></div>
</div>
</div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-69683534784045002802013-08-12T08:31:00.001-07:002013-08-18T07:38:01.686-07:00Configure Content Deployment in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">Content deployment job helps us to copy the contents from
one environment to another environment in a scheduled basis. To Define a
Content deployment path follow below steps.<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 1:</b> Go to <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Central Administration</span></b> </span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;"> <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Configure content deployment paths and jobs</span></b> [under General
application settings]</span><span style="font-family: Calibri;"> </span></div>
<span style="font-family: Calibri;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Calibri;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghf7PflKhqc3g7uXhmi7qoG8r8N2YFRBg3DPddEHeff8dDD5KdSI9LrXhWT6wU6zbfjV2ffSf2AyZqnKkgh3njLVnQRNlBN-CooxmV4G4oxumUkeq21OlvE4JV1zgOZM6pgH8UqxShF1it/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="407" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghf7PflKhqc3g7uXhmi7qoG8r8N2YFRBg3DPddEHeff8dDD5KdSI9LrXhWT6wU6zbfjV2ffSf2AyZqnKkgh3njLVnQRNlBN-CooxmV4G4oxumUkeq21OlvE4JV1zgOZM6pgH8UqxShF1it/s1600/1.png" width="640" /></a></span></div>
<span style="font-family: Calibri;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 2: </b>To create
new deployment path,<b style="mso-bidi-font-weight: normal;"> </b>Click on <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">New Path</span></b>.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjU3FF6p8CyusahAbVEvuHddvoDjszUqaeJAWXVf5kYfaTFbyHJh6yW9jeCx4WzbMTxvLtd5M4rAS71CcOF0ohGwKHL4yjdxr78O3qjmh0NouYbp_K2P92PhMgAUy1WU7piuE3vtEsF31g/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjU3FF6p8CyusahAbVEvuHddvoDjszUqaeJAWXVf5kYfaTFbyHJh6yW9jeCx4WzbMTxvLtd5M4rAS71CcOF0ohGwKHL4yjdxr78O3qjmh0NouYbp_K2P92PhMgAUy1WU7piuE3vtEsF31g/s640/1.png" width="640" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 3</b>: In This
Form, mention the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Source environment</span></b>
details and the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Destination environment</span></b>
details and also the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">user account</span></b>
details and Click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">OK</span></b>.</span> </div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;">[<strong><span style="color: black;">Note</span></strong>: While creating <strong><span style="color: #cc0000;">Destination Site Collection</span></strong> make sure
to create it as<strong><span style="color: #cc0000;"> Empty Site Collection</span></strong> to have a smooth Deployment without any
issues.]</span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtYwdrZ-LGVP52s1NzLl5K6Fiw2w2_nig7gHY_QAkXrrIWjNWWThw7PqLr6cRU-jtir0frSA9KBgytV-9Ol8YgxB-U91sM94JlHVSvujwzjsVh5V-C41i51PFNaCeR9PCJuZq3LqmowOrU/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="614" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtYwdrZ-LGVP52s1NzLl5K6Fiw2w2_nig7gHY_QAkXrrIWjNWWThw7PqLr6cRU-jtir0frSA9KBgytV-9Ol8YgxB-U91sM94JlHVSvujwzjsVh5V-C41i51PFNaCeR9PCJuZq3LqmowOrU/s640/2.png" width="640" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 4: </b>To create
a new Job, Select <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Create Job</span></b> from
the drop down.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI8HKSIdkGjRBNLZCMeZb-NPiJZhRoJjSjZdb4ejsYxIvIC7Hbfu2frzsqkHs542jZGrxgGfTJskAAZPv6OY0jZZ4Zhfwvo0I3FKTyliO1nLdmhRWAwPZdkBUA-CySnULn1io9FMTN4KVe/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI8HKSIdkGjRBNLZCMeZb-NPiJZhRoJjSjZdb4ejsYxIvIC7Hbfu2frzsqkHs542jZGrxgGfTJskAAZPv6OY0jZZ4Zhfwvo0I3FKTyliO1nLdmhRWAwPZdkBUA-CySnULn1io9FMTN4KVe/s640/5.png" width="640" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 5: </b>Select
the <span style="color: #cc0000;">respective deployment path from the dropdown</span> and specify the schedule, in
which you want to run the deployment job.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaWq7h4yUvOju1WG59rrxrXNCDzpnN61LwMOh-hALhfw2uQiqoF8Ys0z3zCtl4idSQdYZdtoHJvURlEdlWe0CTqDTHE_5KqaeeesiPdSK_-2PPLhbRlS2QSiu2rfKiNnzU7BC7HJjuh-8m/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaWq7h4yUvOju1WG59rrxrXNCDzpnN61LwMOh-hALhfw2uQiqoF8Ys0z3zCtl4idSQdYZdtoHJvURlEdlWe0CTqDTHE_5KqaeeesiPdSK_-2PPLhbRlS2QSiu2rfKiNnzU7BC7HJjuh-8m/s640/3.png" width="626" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 6: </b>To run
the job immediately, select <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Run Now</span> </b>from
the drop down. And to view the Status report, click on the<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Status message</b></span>.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuP1fqsV1RPQYsN9fSEc0puA4teAiDl4zempjHR3Yqk3KRRyINdqWVO00AY2etbXi8qaLdOVE0g8kzD_LG3WcguT5H-Fa-d6mphQBrcrdBqmPK_2jmlyxhn5R3WS2gt953RyselVyD79Wb/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuP1fqsV1RPQYsN9fSEc0puA4teAiDl4zempjHR3Yqk3KRRyINdqWVO00AY2etbXi8qaLdOVE0g8kzD_LG3WcguT5H-Fa-d6mphQBrcrdBqmPK_2jmlyxhn5R3WS2gt953RyselVyD79Wb/s640/4.png" width="640" /></a></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-64791257934620892552013-08-12T08:10:00.000-07:002013-08-18T07:42:19.717-07:00Configure Content Source in SharePoint 2010 Search<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 1:</b> To
configure the Content Source Navigate to <span style="color: #cc0000;"><b style="mso-bidi-font-weight: normal;">Central
Administration</b> </span></span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;"><span style="color: black;">à</span></span></span><span style="font-family: Calibri;"><span style="color: #cc0000;">
</span><b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Manage Service</span> <span style="color: #cc0000;">Application</span> </b></span><span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">à</span></span><span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"> <span style="color: #cc0000;">Search Service Application</span> </b>and click on the<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Content Sources</b></span> from the Quick Launch.<o:p></o:p></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkVwUdWlVKSdI1fmtNTb4tAuaF4ODwJgEdiXC_N_ztSyFh9UamJqQiP7cOswZNCNZ9RmQgx-NGMFwN5N_CtaI8m6sPJPKxVshAx-BcA3uRxOf-j0YL_-xAyqvAkJALDiTch7SkF5d5PEyj/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkVwUdWlVKSdI1fmtNTb4tAuaF4ODwJgEdiXC_N_ztSyFh9UamJqQiP7cOswZNCNZ9RmQgx-NGMFwN5N_CtaI8m6sPJPKxVshAx-BcA3uRxOf-j0YL_-xAyqvAkJALDiTch7SkF5d5PEyj/s640/1.png" width="640" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 2: </b>Specify
the <span style="color: #cc0000;"><b style="mso-bidi-font-weight: normal;">Content Source</b> <b style="mso-bidi-font-weight: normal;">name</b></span> and specify the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">site URL</span></b> where the search crawl should
start [Note: Same URL will not be accepted in different content sources]. And
give the Schedule for <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Full crawl</span></b> and<span style="color: #cc0000;">
<b style="mso-bidi-font-weight: normal;">Incremental crawl</b></span>. Then click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">OK</span></b>.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOGvv5r_GBUnRmzGj9z-uPgw0-SrP2N_-XcbjAvsZEXl-rpHgFtAEAlgVt5VZ0IlEK_7HBCiExqU2eZEKWtrv6fOl_6azbQXwc30EUhciXieBJRTLNmDDlY9qetpVbmJHRA1O3l22QE7Kg/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="558" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOGvv5r_GBUnRmzGj9z-uPgw0-SrP2N_-XcbjAvsZEXl-rpHgFtAEAlgVt5VZ0IlEK_7HBCiExqU2eZEKWtrv6fOl_6azbQXwc30EUhciXieBJRTLNmDDlY9qetpVbmJHRA1O3l22QE7Kg/s640/2.png" width="640" /></a></div>
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Arial; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Once the Content
Source is created, we need to start the crawling so that contents will be
available for search.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKBV5G40Xve2ToBVscd0Jc00tT7tyIAlbq7CzjfK_NldOIacgvXt8zlBBxDy7fuN5-fInurtaHsnuXpWqPvxwlsn8YTur5K1DkpzO6SIzhTaDxfXE9ar-y1NuLcE8Vk-rVMrj9ZfM6WR4L/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="372" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKBV5G40Xve2ToBVscd0Jc00tT7tyIAlbq7CzjfK_NldOIacgvXt8zlBBxDy7fuN5-fInurtaHsnuXpWqPvxwlsn8YTur5K1DkpzO6SIzhTaDxfXE9ar-y1NuLcE8Vk-rVMrj9ZfM6WR4L/s640/3.png" width="640" /></a></div>
</div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-57967351887131308152013-08-12T04:56:00.001-07:002013-08-12T05:01:34.943-07:00Enable Anonymous Access at Lists/Libraries in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">To Enable or Change the Permission levels for <span style="color: #cc0000;"><strong>anonymous
users in Lists/Libraries</strong></span>, follow below steps<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><strong>Step 1</strong>: Navigate to the respective List/Library settings and
select <span style="color: #cc0000;">Permissions for this list</span> under <span style="color: #cc0000;"><strong>Permissions and management</strong></span>.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="mso-no-proof: yes;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f"><span style="font-family: Calibri;">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></span></v:shapetype><span style="font-family: Calibri;"></span></span></div>
<span style="font-family: Calibri;"></span><br />
<span style="font-family: Calibri;"><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbzTipDEayZ6XYv4awYrTGIrS2ZgZnu90eGd1oC_ij40OJBNAhR5Ebc5bmZNfHyh9jd2psKpuhF9gKhBHkOutV-1Hx28n4z6S1q4jiAv3QoxSazSz2ZqJyOo4la1F0rH7skWzNj1xFO98V/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbzTipDEayZ6XYv4awYrTGIrS2ZgZnu90eGd1oC_ij40OJBNAhR5Ebc5bmZNfHyh9jd2psKpuhF9gKhBHkOutV-1Hx28n4z6S1q4jiAv3QoxSazSz2ZqJyOo4la1F0rH7skWzNj1xFO98V/s640/1.png" width="640" /></a></div>
</span><o:p></o:p><br />
<span style="font-family: Calibri;"><strong>Step 2</strong>: Then select <span style="color: #cc0000;"><strong>Anonymous access</strong></span> from Ribbon.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhukJbqoPVwViLl1eKrU-Qw0z9KX32brB3iJNUdjuOpH1IhOd81UdaANbkJuJvL22gACyyQo1qVvyO_1mIL_LST8MLhfwMeRSQSBh1ftOBpc3PKlomvmhxC-N-WK84IQY2sz9fpkO0gvOcp/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="398" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhukJbqoPVwViLl1eKrU-Qw0z9KX32brB3iJNUdjuOpH1IhOd81UdaANbkJuJvL22gACyyQo1qVvyO_1mIL_LST8MLhfwMeRSQSBh1ftOBpc3PKlomvmhxC-N-WK84IQY2sz9fpkO0gvOcp/s640/2.png" width="640" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 3: </b>From the
popup, select the suitable option and click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Ok</span></b>. </span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjli5F7MoLaANUVycT5dqXQn59zTVS0efh5iaWtfiS2y5e6Ggfs53I6bng1lHEybDSoLkFqQSVif0UH-ZUKZGEBgecJ3A67zDK5NejNz7qbIYgQGtfwv_LRs0iejuIHd0-ENe09S8JOH1cs/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjli5F7MoLaANUVycT5dqXQn59zTVS0efh5iaWtfiS2y5e6Ggfs53I6bng1lHEybDSoLkFqQSVif0UH-ZUKZGEBgecJ3A67zDK5NejNz7qbIYgQGtfwv_LRs0iejuIHd0-ENe09S8JOH1cs/s1600/3.png" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="mso-no-proof: yes;"></span><o:p></o:p> </div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-62620770981589681652013-08-12T03:53:00.004-07:002013-08-18T12:21:57.526-07:00Enable Anonymous Access at Site Collection in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">To Enable <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Anonymous
Access</span></b> for a Site Collection, follow below steps<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 1: </b>Navigate
to <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Site settings</span></b> and select <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Site permissions</span></b> under <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Users and Permissions</span></b></span><br />
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;"><br /></span></b></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwcA4zl8Mqri6fN2cZwbRUpLgSa4-dUDFgQPMkCgaYJ8zRvKAELJao-nWmxgpCi2dJB8oOpxM9qOPKaEutLiqbZ15JuZN8_9LxldgFgkt5miuIIaA3U5ZGYk74WRvheN7Zvsf8aw8NkVwQ/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwcA4zl8Mqri6fN2cZwbRUpLgSa4-dUDFgQPMkCgaYJ8zRvKAELJao-nWmxgpCi2dJB8oOpxM9qOPKaEutLiqbZ15JuZN8_9LxldgFgkt5miuIIaA3U5ZGYk74WRvheN7Zvsf8aw8NkVwQ/s640/1.png" width="640" /></a></div>
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 2: </b>Select <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Anonymous access</span></b> from ribbon.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBIrP65K6OPzWKStqMiLBqjFiLmhXTbP8JFkz5z1pBTSSX7Kcmalk_sJtUvDB34NwEPSCzNLuXEYmQaOwaIYMomP1rhoU1i8j44x9UwUmsz_etcBxrwg2BHtAf_IbQ_WLAPIR0xh2slMR8/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="365" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBIrP65K6OPzWKStqMiLBqjFiLmhXTbP8JFkz5z1pBTSSX7Kcmalk_sJtUvDB34NwEPSCzNLuXEYmQaOwaIYMomP1rhoU1i8j44x9UwUmsz_etcBxrwg2BHtAf_IbQ_WLAPIR0xh2slMR8/s640/2.png" width="640" /></a></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 3: </b>From the
popup, select the suitable option and click <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Ok</span></b>. Now the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">anonymous access</span></b>
is enabled at <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Site collection</span></b>.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84ufTuvuRzc5mGNvC_nxPxfMuaeeqNtY4A0d7mbY1g5c-fpKLb35onjhWp9fFgly7DllYOQ2hJluuJz-v11mzZTMtIwMb7Fvd44Xus4STvw3c181dz1WXCEg6gB1PABBU7BE4-tPe7DwV/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="449" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84ufTuvuRzc5mGNvC_nxPxfMuaeeqNtY4A0d7mbY1g5c-fpKLb35onjhWp9fFgly7DllYOQ2hJluuJz-v11mzZTMtIwMb7Fvd44Xus4STvw3c181dz1WXCEg6gB1PABBU7BE4-tPe7DwV/s640/3.png" width="640" /></a></div>
</div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="mso-no-proof: yes;"><v:shape id="Picture_x0020_7" o:spid="_x0000_i1025" style="height: 288.75pt; mso-wrap-style: square; visibility: visible; width: 468pt;" type="#_x0000_t75"><span style="font-family: Calibri;">
<v:imagedata o:title="" src="file:///C:\Users\DINESH~1.NAT\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png">
Read<span style="color: #0b5394;"><strong> </strong></span><a href="http://sharepoint-tamizha.blogspot.com/2013/08/enable-anonymous-access-at.html"><span style="color: #0b5394;"><strong>this article</strong></span></a> to know how to <span style="color: #cc0000;"><strong>Enable Anonymous access at List/Library Level</strong></span>.</v:imagedata></span></v:shape></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
</div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0tag:blogger.com,1999:blog-1384698425625365255.post-80562042651344958252013-08-12T03:04:00.000-07:002013-08-18T07:50:05.140-07:00Enable Anonymous Access at Web Application in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Calibri;">To Enable<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">Anonymous
Access</b></span> for a Web Application, follow below steps<o:p></o:p></span><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><span style="color: black;"><b style="mso-bidi-font-weight: normal;">Step 1</b>:</span> Open <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Central Administration</span></b>, click on <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Manage web applications</span></b> under <span style="color: #cc0000;"><b style="mso-bidi-font-weight: normal;">Application Management</b>.</span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Calibri;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1ZyaNxFUUmsynatyVy0tHZGuJ7oiymTQ6P2PqHkhkqrQ5F1-yqxiFhNKe4eQ6-da21TjoBHtmrl-HiKUNvRFtmz9uam7flF6B3kIYDn3thbH0TrRsNaduAsZp4FY8N1nR10Ta30G_mDbY/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1ZyaNxFUUmsynatyVy0tHZGuJ7oiymTQ6P2PqHkhkqrQ5F1-yqxiFhNKe4eQ6-da21TjoBHtmrl-HiKUNvRFtmz9uam7flF6B3kIYDn3thbH0TrRsNaduAsZp4FY8N1nR10Ta30G_mDbY/s640/1.png" width="640" /></a></span></div>
<span style="font-family: Calibri;">
</span><o:p></o:p>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<o:p><span style="color: #0b5394; font-family: Calibri;"> </span></o:p><span style="font-family: Calibri;"><span style="color: black;"><b style="mso-bidi-font-weight: normal;">Step 2</b>:</span> Select
the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Web Application</span></b> for which you
need to Enable<span style="color: #cc0000;"> <b style="mso-bidi-font-weight: normal;">anonymous access</b></span> and
click the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Authentication providers</span> </b>from
the <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Ribbon</span>.</b></span> </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA5g9VUkg_7Uze5_XobPQynsG9c-vRJ33QvFu6KQLds3CgIb6sVjefC2VhRWagfGsCn9m1X0LTJLPxajOZkJXCcjPvMxUlUNaW53QF5ep7sJfa7Xwh83D68M5j3iAlQ1joVUvCTMaJU3bT/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA5g9VUkg_7Uze5_XobPQynsG9c-vRJ33QvFu6KQLds3CgIb6sVjefC2VhRWagfGsCn9m1X0LTJLPxajOZkJXCcjPvMxUlUNaW53QF5ep7sJfa7Xwh83D68M5j3iAlQ1joVUvCTMaJU3bT/s640/1.png" width="640" /></a></div>
<br />
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;">Step 3: </b>From the
popup, click on <span style="color: #cc0000;"><b style="mso-bidi-font-weight: normal;">Default</b> <b style="mso-bidi-font-weight: normal;">zone</b></span>.</span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1cCKz-cXmuzmN97Nueq0EmllC3n_-lFXGiYZdstuUkQl2sr6kTelem6PWTcqVevg4D2Gn646-Ssm8mjyikcf7akerDpaqsbwVv79FcWjR1hyg8GoCtpY-b0O-pluZGAROZ4fDivnCdU0E/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1cCKz-cXmuzmN97Nueq0EmllC3n_-lFXGiYZdstuUkQl2sr6kTelem6PWTcqVevg4D2Gn646-Ssm8mjyikcf7akerDpaqsbwVv79FcWjR1hyg8GoCtpY-b0O-pluZGAROZ4fDivnCdU0E/s400/3.png" width="400" /></a></div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: Calibri;"><b style="mso-bidi-font-weight: normal;"><span style="mso-no-proof: yes;">Step 4: </span></b><span style="mso-no-proof: yes;">Select
the option <b style="mso-bidi-font-weight: normal;"><span style="color: #cc0000;">Enable anonymous access</span></b>
and the save the changes. Now the Anonymous access is enabled at Web
application level, to enable at Site collection level see </span></span><a href="http://sharepoint-tamizha.blogspot.com/2013/08/enable-anonymous-access-at-site.html"><b style="mso-bidi-font-weight: normal;"><span style="color: blue; font-family: Calibri;">EnableAnonymous Access at Site Collection</span></b></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzMQwHStcdTAEzYwD5VEr_5aqAQEu0ENB7rERpw_O7f955jGrJwLXSWh4IU-t4kNNH9fmrm2wFx__1yE0tc9BFnDWCe3__k1KrPmkhbK1_PsOZ7OeuDTrIRHESpRb4z6FDCt1nEiJXEuZf/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzMQwHStcdTAEzYwD5VEr_5aqAQEu0ENB7rERpw_O7f955jGrJwLXSWh4IU-t4kNNH9fmrm2wFx__1yE0tc9BFnDWCe3__k1KrPmkhbK1_PsOZ7OeuDTrIRHESpRb4z6FDCt1nEiJXEuZf/s1600/4.png" /></a></div>
</div>
Dinesh Natarajanhttp://www.blogger.com/profile/18213482027419393730noreply@blogger.com0