tag:blogger.com,1999:blog-54445792947309722662024-03-13T20:04:42.770-07:00SharePointJyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-5444579294730972266.post-57943074132740962652013-05-22T07:44:00.000-07:002013-05-22T07:44:01.496-07:00Hide Multiple Upload link in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #333333; font-family: Georgia, Times New Roman, serif;"><span style="font-size: 14px; line-height: 19px;">To hide the </span></span><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', serif; font-size: 14.666666984558105px; line-height: 19px;"> “Upload Multiple Files..” link and from the ribbon we should add the </span><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 19px;">below mentioned script in my CSS file (custom CSS file used of my master page). This will hide for all documents libraries for which this CSS is applied.</span><br style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;" /><br style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;" /><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 19px;"><strong>#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_UploadMultipleLink, #Ribbon\.Documents\.New\.AddDocument\.Menu\.Upload\.UploadMultiple-Menu32</strong><br /><strong>{</strong><br /><strong> display: none; </strong><br /><strong>}</strong></span></div>
Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com1tag:blogger.com,1999:blog-5444579294730972266.post-62676889205635358052012-09-05T06:15:00.001-07:002012-09-05T06:15:50.131-07:00Writing/Reading XML<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><b>Writing to XML</b><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">XmlTextWriter</span> writer = <span style="color: blue;">new</span> <span style="color: #2b91af;">XmlTextWriter</span>(<span style="color: #a31515;">"C:/TEMP/product.xml"</span>, System.Text.<span style="color: #2b91af;">Encoding</span>.UTF8);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteStartDocument(<span style="color: blue;">true</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.Formatting = <span style="color: #2b91af;">Formatting</span>.Indented;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.Indentation = 2;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteStartElement(<span style="color: #a31515;">"Properties"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> createNode(<span style="color: #a31515;">"model"</span>, <span style="color: #a31515;">"modelS"</span>, writer);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> createNode(<span style="color: #a31515;">"supplier"</span>, <span style="color: #a31515;">"x"</span>, writer);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteEndElement();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteEndDocument();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.Close();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">Helper Method<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">private</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">static</span> <span style="color: blue;">void</span> createNode(<span style="color: blue;">string</span> key, <span style="color: blue;">string</span> value, <span style="color: #2b91af;">XmlTextWriter</span> writer)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteStartElement(key);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteString(value);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> writer.WriteEndElement();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Calibri;">Reading XML<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">XmlDataDocument</span><span style="font-family: Consolas; font-size: 9.5pt;"> xmldoc = <span style="color: blue;">new</span> <span style="color: #2b91af;">XmlDataDocument</span>();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">XmlNodeList</span> xmlnode;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">int</span> i = 0;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">string</span> str = <span style="color: blue;">null</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">FileStream</span> fs = <span style="color: blue;">new</span> <span style="color: #2b91af;">FileStream</span>(<span style="color: #a31515;">"C:/TEMP/product.xml"</span>, <span style="color: #2b91af;">FileMode</span>.Open, <span style="color: #2b91af;">FileAccess</span>.Read);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> xmldoc.Load(fs);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> xmlnode = xmldoc.GetElementsByTagName(<span style="color: #a31515;">"Properties"</span>)[0].ChildNodes;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">for</span> (i = 0; i <= xmlnode.Count - 1; i++)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> { <o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> str = xmlnode[i].Name +<span style="color: #a31515;">" | "</span>+xmlnode[i].ChildNodes.Item(0).InnerText.Trim();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">Console</span>.WriteLine(str);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Consolas; font-size: 9.5pt;">XML Pattern<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Consolas; font-size: 9.5pt;"><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:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><o:p></o:p></span></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-pYAk8Hvk4WM/UEdQdzxWYOI/AAAAAAAAGpc/60zNiZ-9u-U/s1600/product.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" hea="true" height="90" src="http://1.bp.blogspot.com/-pYAk8Hvk4WM/UEdQdzxWYOI/AAAAAAAAGpc/60zNiZ-9u-U/s320/product.png" width="320" /></a></div>
</div>
Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-82392091702894615142012-08-04T04:40:00.001-07:002012-10-17T02:55:23.553-07:00UseFull Links<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 class="post-title" style="text-align: left;">
Disable SharePoint Columns in Edit Form using jQuery</h4>
<a href="http://www.rajsoftsys.com/sharepoint/?p=183">http://www.rajsoftsys.com/sharepoint/?p=183</a><br />
<br />
<strong>Creating Document Sets Programatically</strong><br />
<a href="http://www.sharepoint4developers.net/en-nz/post/creating-document-sets-programmatically.aspx">http://www.sharepoint4developers.net/en-nz/post/creating-document-sets-programmatically.aspx</a><br />
<a href="http://howtosharepoint.blogspot.in/2010/12/programmatically-create-document-set.html">http://howtosharepoint.blogspot.in/2010/12/programmatically-create-document-set.html</a><br />
<div style="text-align: left;">
<br /></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: Niconne, 'Gil Sans Regular', Baskerville, 'Times New Roman', serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<strong>Active Directory With C#</strong></div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: Niconne, 'Gil Sans Regular', Baskerville, 'Times New Roman', serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<a href="http://ianatkinson.net/computing/adcsharp.htm#ex6">http://ianatkinson.net/computing/adcsharp.htm#ex6</a><br />
<a href="http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C#35">http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C#35</a></div>
</div>
Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-66164302135156362712012-07-30T22:42:00.000-07:002012-07-30T22:42:08.860-07:00Workaround: Calling a JavaScript Function from a HyperLinkField in a GridView or SPGridView<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, Helvetica, sans-serif; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri; font-size: small;">If you place a HyperLinkField in a GridView and link it to a
JavaScript function, then it doesn't work properly. The problem is that the URL
specified by the HyperLinkField's<tt>NavigateUrl</tt><span class="Apple-converted-space"> </span>fails to render when you use a JavaScript
reference (such as<span class="Apple-converted-space"> </span><tt>"Javascript:func();"</tt>) rather than a
standard URL.</span></div>
<br />
<div style="background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, Helvetica, sans-serif; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri; font-size: small;"></span> </div>
<br />
<div style="background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, Helvetica, sans-serif; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<span style="font-family: Calibri; font-size: small;">As a workaround, we can use the<span class="Apple-converted-space"> </span><tt>RowDataBoundEvent</tt><span class="Apple-converted-space"> </span>to prepare a proper call to the JavaScript
function. To make this work, while assigning the value we should give<span class="Apple-converted-space"> </span><tt>"Javascript."</tt><span class="Apple-converted-space"> </span>(with a period) instead
of<tt>"Javascript:"</tt><span class="Apple-converted-space"> </span>(with a colon)
</span></div>
<code style="font-size: 12px;">
</code><br />
<code style="font-size: 12px;"><div style="background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, Helvetica, sans-serif; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<br /><span style="font-family: Calibri; font-size: small;">void grid_RowDataBound(object sender, GridViewRowEventArgs
e)<br />{<br />//if it is not DataRow return.<br />if (e.Row.RowType !=
DataControlRowType.DataRow)<br />{<br />return;<br />}<br />//Loop thru the cells
changing the "." to ":" in hyperlink navigate URLs<br />for (int i = 0; i <
e.Row.Cells.Count; i++)<br />{<br />TableCell td = e.Row.Cells[i];<br />if
(td.Controls.Count > 0 && td.Controls[0] is
HyperLink)<br />{<br />HyperLink hyperLink = td.Controls[0] as HyperLink;<br />string
navigateUrl = hyperLink.NavigateUrl.ToLower();<br />hyperLink.NavigateUrl =
hyperLink.NavigateUrl.Replace(<br />hyperLink.NavigateUrl.Substring(<br />navigateUrl.IndexOf("javascript."),
"javascript.".Length),<br />"javascript:");<br />}<br />}<br />}</span></div>
</code></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-82063296521019497382012-07-05T10:27:00.001-07:002012-07-05T10:27:18.783-07:00Full list of SPBuiltInField Ids can be found here<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbuiltinfieldid_members.aspx">http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbuiltinfieldid_members.aspx</a></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-18406168284685680502012-07-04T06:08:00.000-07:002012-07-04T06:08:51.394-07:00Get/Set Values for Managed MetaData Field<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Calibri;">Get Terms from the Field:</span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TaxonomyField</span><span style="font-family: Consolas; font-size: 9.5pt;"> commodityGrpFld = (<span style="color: #2b91af;">TaxonomyField</span>)web.Fields[<span style="color: red;">“FieldName”</span>];</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: green;">// get the Term Store ID from the field</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">Guid</span> commodityGrptermStoreId = commodityGrpFld.SspId;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: green;">// Open a taxonomysession and get the correct termstore</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TaxonomySession</span> session = <span style="color: blue;">new</span> <span style="color: #2b91af;">TaxonomySession</span>(oSite);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TermStore</span> termStore = session.TermStores[commodityGrptermStoreId]; </span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> #region</span><span style="font-family: Consolas; font-size: 9.5pt;"> get terms from commodity termset</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">try</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TermSet</span> termSetCommodity = termStore.GetTermSet(commodityGrpFld.TermSetId); </span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (termSetCommodity != <span style="color: blue;">null</span>)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TermCollection</span> CommodityTermColl = termSetCommodity.Terms;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">ArrayList</span> commodityList = <span style="color: blue;">new</span> <span style="color: #2b91af;">ArrayList</span>();</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">Term</span> commTerm <span style="color: blue;">in</span> CommodityTermColl)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> commodityList.Add(commTerm.Name);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;">
<span style="color: green; font-family: Consolas; font-size: 9.5pt;">//binding to listbox</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> lbCommodityGrp.DataSource = commodityList;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> lbCommodityGrp.DataBind();</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span>)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> { }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"> #endregion</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Calibri;">Update the Item value for Managed Metadata field:</span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TaxonomyField</span><span style="font-family: Consolas; font-size: 9.5pt;"> taxoField_Commodity =spfile.Item.Fields[[<span style="color: red;">“FieldName”</span>] <span style="color: blue;">as</span> <span style="color: #2b91af;">TaxonomyField</span>;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TaxonomySession</span> taxoSession = <span style="color: blue;">new</span> <span style="color: #2b91af;">TaxonomySession</span>(oSite);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TermStore</span> store = taxoSession.TermStores[taxoField_Commodity.SspId];</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TermSet</span> termSet = store.GetTermSet(taxoField_Commodity.TermSetId);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (taxoField_Commodity.AllowMultipleValues)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> { </span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TermCollection</span> terms = termSet.GetAllTerms();</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">List</span><<span style="color: blue;">string</span>> taxonomyValueList = <span style="color: blue;">new</span> <span style="color: #2b91af;">List</span><<span style="color: blue;">string</span>>();</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">ListItem</span> item <span style="color: blue;">in</span> lbCommodityGrp.Items)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (item.Selected)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> taxonomyValueList.Add(item.Value);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TaxonomyFieldValueCollection</span> fieldValues = <span style="color: blue;">new</span> <span style="color: #2b91af;">TaxonomyFieldValueCollection</span>(taxoField_Commodity);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">Term</span> term <span style="color: blue;">in</span> terms)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (taxonomyValueList.Contains(term.Name))</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">TaxonomyFieldValue</span> fieldValue = <span style="color: blue;">new</span> <span style="color: #2b91af;">TaxonomyFieldValue</span>(taxoField_Commodity);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> fieldValue.TermGuid = term.Id.ToString();</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> fieldValue.Label = term.Name;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> fieldValues.Add(fieldValue);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> taxoField_Commodity.SetFieldValue(spfile.Item, fieldValues);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Calibri;">Get the Item value for Managed Metadata field:</span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><b> </b>We need to convert the item value to </span><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">TaxonomyFieldValueCollection</span></div>
</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-43038808626403403962012-07-02T21:28:00.002-07:002012-07-02T21:28:33.304-07:00Using SharePoint 2010 Content Organizer to Route Documents<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #f7f7f7; color: #333333; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/22px Tahoma, Arial, Helvetica, sans-serif; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">This video walks through the process of uploading, saving, and routing documents based on content type metadata values by levereging Microsoft SharePoint Server 2010 Content Organizer feature.</span><br />
<br />
<a href="http://sharepointquester.com/2012/03/06/how-to-route-documents-based-on-metadata-using-the-content-organizer-feature/">http://sharepointquester.com/2012/03/06/how-to-route-documents-based-on-metadata-using-the-content-organizer-feature/</a></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-5324784300104539462012-07-02T03:31:00.002-07:002012-07-02T03:31:28.957-07:00Programmatically Create a ‘Send To’ Connection to Send Documents to The Records Center in SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">If you have
multiple send to connections to create or prefer to automate the deployment
tasks related to your SharePoint environment, the following bit of code will
help you create them automatically using the SPOfficialFileHost collection of
your current site’s web application:<o:p></o:p></span></span><br />
<br />
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">using
(SPSite site = new SPSite(<a href="http://sp/">http://sp/</a>))</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">{<o:p></o:p></span></span></div>
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> SPWebApplication
webapp = site.WebApplication;</span></span><br />
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> SPOfficialFileHost
newhost = new SPOfficialFileHost(true);</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> newhost.OfficialFileUrl
= new Uri(site.Url+"/records/_vti_bin/officialfile.asmx");</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> newhost.OfficialFileName
= "Records Center";</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> newhost.ShowOnSendToMenu
= true;</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> newhost.Action
= SPOfficialFileAction.Move;</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> webapp.OfficialFileHosts.Add(newhost); </span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;"> webapp.Update();</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">}</span></span></div>
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<br /></div>
<br />
<div class="MsoNormal" style="line-height: 10.5pt; margin: 0in 0in 0pt;">
<span style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">The
options for the action are the following:</span></span></div>
<div class="MsoListParagraphCxSpFirst" style="line-height: 10.5pt; margin: 0in 0in 6pt 0.5in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="color: black; font-size: 10pt; 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 style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">You can move the document from one location to another<br />
SPOfficialFileAction.Move;</span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="line-height: 10.5pt; margin: 0in 0in 6pt 0.5in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="color: black; font-size: 10pt; 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 style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">You can create a copy of the document and send it to another
location<br />
SPOfficialFileAction.Copy;</span></span></div>
<div class="MsoListParagraphCxSpLast" style="line-height: 10.5pt; margin: 0in 0in 6pt 0.5in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -0.25in;">
<span style="color: black; font-size: 10pt; 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 style="color: black; font-size: 10pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Calibri;">Or you can move the document but leave a link of its new location
in its former location<br />
SPOfficialFileAction.Link;<o:p></o:p></span></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 10pt;">
<br /></div>
</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com1tag:blogger.com,1999:blog-5444579294730972266.post-29535741226822154532012-05-17T09:20:00.001-07:002012-05-17T09:20:39.311-07:00Problem Sorting With Multiple SPGridViews<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;"><span style="background: white; color: black; font-size: 12pt;">I have experienced a funny behavior by having two SPGridviews along with ObjectDataSource on the same page. Both the SPGirdViews are enabled with sorting, filtering and pagination. Filtering and Pagination worked perfectly without any issues. If it comes to sorting point of view, whenever you try to sort the lower SPGridView it gets applied to upper SPGridView.</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span class="apple-converted-space"><span style="background: white; color: black; font-size: 12pt;"><span style="font-family: Calibri;">The Hack for this issue:</span></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span class="apple-converted-space"><span style="background: white; color: black; font-size: 12pt;"><span style="font-family: Calibri;"> </span></span></span><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> OnPreRender(<span style="color: #2b91af;">EventArgs</span> e)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> { </span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (SPGridView1.HeaderRow != <span style="color: blue;">null</span>)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">WebControl</span> control <span style="color: blue;">in</span> <span style="color: blue;">this</span>.SPGridView1.HeaderRow.Controls)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> UpdateTemplateClientID(control, SPGridView1.ClientID);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (SPGridView2.HeaderRow != <span style="color: blue;">null</span>)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">WebControl</span> control <span style="color: blue;">in</span> <span style="color: blue;">this</span>.SPGridView2.HeaderRow.Controls)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> UpdateTemplateClientID(control, SPGridView2.ClientID);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">base</span>.OnPreRender(e);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">private</span> <span style="color: blue;">void</span> UpdateTemplateClientID(<span style="color: #2b91af;">Control</span> control, <span style="color: blue;">string</span> clientID)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">if</span> (control <span style="color: blue;">is</span> Microsoft.SharePoint.WebControls.<span style="color: #2b91af;">Menu</span>)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> Microsoft.SharePoint.WebControls.<span style="color: #2b91af;">Menu</span> menuControl = control <span style="color: blue;">as</span> Microsoft.SharePoint.WebControls.<span style="color: #2b91af;">Menu</span>;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">string</span> jsFunctionCall = menuControl.ClientOnClickPreMenuOpen;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> menuControl.ClientOnClickPreMenuOpen = jsFunctionCall.Replace(<span style="color: #a31515;">"%TEMPLATECLIENTID%"</span>, clientID + <span style="color: #a31515;">"_SPGridViewFilterMenuTemplate"</span>);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">else</span> <span style="color: blue;">if</span> (control.HasControls())</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">foreach</span> (<span style="color: #2b91af;">WebControl</span> c <span style="color: blue;">in</span> control.Controls)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> UpdateTemplateClientID(c, clientID);</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com2tag:blogger.com,1999:blog-5444579294730972266.post-1230972991053005732012-05-15T23:36:00.003-07:002012-05-15T23:44:08.696-07:00Sample Examples of ShowModalDialog<div dir="ltr" style="text-align: left;" trbidi="on">
<strong><span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">For showing the div:</span></strong><span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><script type="text/javascript"></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">function showDialog() {</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">var _html = document.createElement('div');</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">_html.innerHTML = document.getElementById('WfHistory').innerHTML;</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">var _options = { html: _html , title: "View History",</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">allowMaximize: false,</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">showClose: true,</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">autoSize: true}; </span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">SP.UI.ModalDialog.showModalDialog(_options);}</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></script></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><asp:LinkButton id="hlViewHistory" runat="server" OnClientClick="showDialog();return false;" Text="Show Full History" /></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><div id="WfHistory" style="display:none" > </span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">....</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></div> </span><br />
<br />
<strong><span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">For showing the aspx page:</span></strong><span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><script type="text/javascript"></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">function showDialog() {</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">var list = document.getElementById("<%= hdnParamList.ClientID %>").value;</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">var _options = { title: "View History",</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">allowMaximize: false,</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">showClose: true,</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">autoSize: true,</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">url: "ViewHistory.aspx?List=" + list };</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">SP.UI.ModalDialog.showModalDialog(_options);}</span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></script></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><asp:LinkButton id="lbViewHistory" runat="server" OnClientClick="showDialog();return false;" Text="Show Full History" />script>div id="WfHistory" style="display:none" ></span><br />
<br />
<strong><span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Close Popup inside CodeBehind:</span></strong><span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span><br />
<span style="font-family: "Calibri", "sans-serif"; font-size: 10pt; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">StringBuilder sbScript1 = new StringBuilder();<br />sbScript1.Append("<script language='javascript'>");<br />sbScript1.Append("window.frameElement.commitPopup();<");<br />sbScript1.Append("/script>");<br />ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "closepopup", sbScript1.ToString(), false);</span><br />
</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-21119004525964982212012-05-03T00:34:00.001-07:002012-05-03T00:34:01.583-07:00Reusable Code Snippet to disable EventFiring<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">For disabling the events inside the extended class of </span><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">SPItemEventReceiver</span><span style="font-family: Calibri;"> then we will have a property named </span><span style="font-family: Consolas; font-size: 9.5pt;">EventFiringEnabled. </span><span style="font-family: Calibri;">But if our class doesn’t extend</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: #2b91af;">SPItemEventReceiver</span></span><span style="font-family: Calibri;"> then we can use the object of below class.</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<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;">class</span> <span style="color: #2b91af;">SPItemEventReceiverHandling</span> : <span style="color: #2b91af;">SPItemEventReceiver</span>, <span style="color: #2b91af;">IDisposable</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">public</span> SPItemEventReceiverHandling(<span style="color: blue;">bool</span> disableImmediately)</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> EventFiringEnabled = !disableImmediately;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> } </span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">public</span> <span style="color: blue;">void</span> Dispose()</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> {</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> EventFiringEnabled = <span style="color: blue;">true</span>;</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">Example: item represents SPListItem</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<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> eventReceiverManager = <span style="color: blue;">new</span> <span style="color: #2b91af;">SPItemEventReceiverHandling</span>(<span style="color: blue;">true</span>))</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;">{</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;"> item.Update();</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Consolas; font-size: 9.5pt;">}</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<br /></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: Consolas; font-size: 9.5pt;">Note:</span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Calibri;">If the version of MOSS is 2007 then use <b>EnableEventFiring</b> and <b>DisableEventFiring </b>methods instead of <b>EventFiringEnabled </b>property.</span></div>
</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-33493587086711334532012-04-30T22:06:00.001-07:002012-04-30T22:06:22.343-07:00JavaScript error using date picker inside an update panel?<div dir="ltr" style="text-align: left;" trbidi="on">
Just include the datepicker.js file explicitly on the page<br />
<script type="text/javascript" src="/_layouts/datepicker.js"></script></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-22534926913647539122012-03-28T21:18:00.000-07:002012-04-30T23:18:42.445-07:00Upload Files into sharepoint library using FileUpload control<div dir="ltr" style="text-align: left;" trbidi="on">
<span lang="EN">string documentlibraryname = ConfigurationManager.AppSettings["DocumentLibraryName"];<br />string folderpath = ConfigurationManager.AppSettings["TempFolderLocation"];<br /><br />try<br />{<br />HttpFileCollection hfc = Request.Files;<br /><br />for (int i = 0; i < hfc.Count; i++)<br />{<br />HttpPostedFile hpf = hfc[i];<br />if (hpf.ContentLength > 0)<br />{<br />//folderpath + <br />//Get proper file name<br />string strFileName = hpf.FileName;<br />strFileName = Path.GetFileName(strFileName);<br /><br />string TempFileName = folderpath + strFileName;<br />hpf.SaveAs(TempFileName);<br />String fileToUpload = TempFileName;<br />String sharePointSite = SPContext.Current.Web.Url;<br />using (SPSite oSite = new SPSite(sharePointSite))<br />{<br />using (SPWeb oWeb = oSite.OpenWeb())<br />{<br />oWeb.AllowUnsafeUpdates = true;<br />if (!System.IO.File.Exists(fileToUpload))<br />throw new FileNotFoundException("File not found.", fileToUpload);<br />string[] folders = folderName.Split(';');<br />String url = oWeb.Lists[documentlibraryname].RootFolder.ServerRelativeUrl.ToString();<br />foreach (string subFolder in folders)<br />{<br />url += "/" + subFolder.Trim();<br />}<br />Boolean replaceExistingFiles = true;<br />String fileName = System.IO.Path.GetFileName(fileToUpload);<br />FileStream fileStream = File.OpenRead(fileToUpload);<br />SPFile spfile = oWeb.GetFolder(url).Files.Add(fileName, fileStream, replaceExistingFiles);<br />spfile.Item["Name"] = fileName;<br />spfile.Item["Created By"] = SPContext.Current.Web.CurrentUser;<br />spfile.Item["Modified By"] = SPContext.Current.Web.CurrentUser;<br />spfile.Item.Update();<br />fileStream.Flush();<br />fileStream.Close();<br />fileStream.Dispose();<br />oWeb.AllowUnsafeUpdates = false;<br />}<br />}<br />}<br />}<br />}<br /><br />catch (Exception ex)<br />{<br />lblMessage.Text = ex.ToString();<br />}<br />HttpFileCollection hfc1 = Request.Files; <br />if(hfc1.Count==0)<br />lblMessage.Text = "Please select at least one file to upload";</span></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com1tag:blogger.com,1999:blog-5444579294730972266.post-87123488207612842752012-03-28T21:12:00.000-07:002012-03-28T21:12:01.788-07:00Download Files from Web[c#]<div dir="ltr" style="text-align: left;" trbidi="on"><h1>Download Files from Web [C#]</h1>This example shows how to <strong>download files</strong> from any website <strong>to local disk</strong>. The simply way how to download file is to use <a href="http://msdn2.microsoft.com/en-us/library/system.net.webclient.aspx" rel="nofollow">WebClient</a> class and its method <a href="http://msdn2.microsoft.com/en-us/library/ez801hhe.aspx" rel="nofollow">DownloadFile</a>. This method has two parameters, first is the <strong>url of the file</strong> you want to download and the second parameter is <strong>path to local disk</strong> to which you want to save the file.<br />
<h2>Download File Synchronously</h2>The following code shows how to download file synchronously. This method blocks the main thread until the file is downloaded or an error occur (in this case the WebException is thrown).<br />
[C#]<br />
<pre class="code"><span class="keyword">using</span> System.Net;
<span class="type">WebClient</span> webClient = <span class="keyword">new</span> <span class="type">WebClient</span>();
webClient.<strong>DownloadFile</strong>(<span class="string">"http://mysite.com/myfile.txt"</span>, <span class="string">@"c:\myfile.txt"</span>);
</pre><h2>Download File Asynchronously</h2>To download file without blocking the main thread use asynchronous method <a href="http://msdn2.microsoft.com/en-us/library/ms144196.aspx" rel="nofollow">DownloadFileAsync</a>. You can also set event handlers to <strong>show progress</strong> and to detect that the <strong>file is downloaded</strong>.<br />
[C#]<br />
<pre class="code"><span class="keyword">private void</span> btnDownload_Click(<span class="keyword">object</span> sender, <span class="type">EventArgs</span> e)
{
<span class="type">WebClient</span> webClient = <span class="keyword">new</span> <span class="type">WebClient</span>();
webClient.DownloadFileCompleted += <span class="keyword">new</span> <span class="type">AsyncCompletedEventHandler</span>(Completed);
webClient.DownloadProgressChanged += <span class="keyword">new</span> <span class="type">DownloadProgressChangedEventHandler</span>(ProgressChanged);
webClient.<strong>DownloadFileAsync</strong>(<span class="keyword">new</span> <span class="type">Uri</span>(<span class="string">"http://mysite.com/myfile.txt"</span>), <span class="string">@"c:\myfile.txt"</span>);
}
<span class="keyword">private void</span> ProgressChanged(<span class="keyword">object</span> sender, <span class="type">DownloadProgressChangedEventArgs</span> e)
{
progressBar.Value = e.ProgressPercentage;
}
<span class="keyword">private void</span> Completed(<span class="keyword">object</span> sender, <span class="type">AsyncCompletedEventArgs</span> e)
{
<span class="type">MessageBox</span>.Show(<span class="string">"Download completed!"</span>);
}
</pre><i><b>Note:</b> Although you use asynchronous method, it can block the main thread for a while. It's because before the async download itself, it checks the DNS name (in this case „mysite.com“) and this check is done internally by blocking function. If you use directly IP instead of domain name, the DownloadFileAsync method will be fully asynchronous.</i></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-72795473069649767452011-06-01T03:10:00.000-07:002011-06-01T03:11:12.126-07:00Adding New Discussion and replying to the Discussion Item using Object Model<div dir="ltr" style="text-align: left;" trbidi="on"><strong><span style="font-family: "Courier New"; font-size: 10pt; mso-no-proof: yes;">New Discussion:</span></strong> <br />
<div class="MsoNormal" style="margin: 0in 0.9pt 0pt 0.75in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: "Courier New"; font-size: 10pt;">SPListItem</span><span style="font-family: "Courier New"; font-size: 10pt;"> oListItem =<span style="color: #2b91af;">SPUtility</span>.CreateNewDiscussion(oList.Items, TitleField.Text);</span></div><div class="MsoNormal" style="margin: 0in 0.9pt 0pt 0.25in; mso-layout-grid-align: none; text-indent: 0.5in;"><span style="font-family: "Courier New"; font-size: 10pt;">oListItem[<span style="color: #2b91af;">SPBuiltInFieldId</span>.Body] = MessageBox.Text; </span></div><span style="font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"> oListItem.Update();</span><br />
<span style="font-family: "Courier New"; font-size: 10pt; 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="font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><strong><span style="font-family: "Courier New"; font-size: 10pt; mso-fareast-font-family: "Courier New";"><span style="mso-list: Ignore;"><span style="font-family: "Times New Roman";"> </span></span></span><span style="font-family: "Courier New"; font-size: 10pt;">Discussion reply:</span></strong></span><br />
<pre style="margin-left: 0.75in;">SPListItem parent = list.GetItemById(parentId);</pre><pre><span style="mso-tab-count: 1;"> </span>SPListItem reply = SPUtility.CreateNewDiscussionReply(parent);</pre><pre style="margin-left: 0.75in;">reply[SPBuiltInFieldId.Body] = body;</pre><span style="font-family: "Times New Roman", "serif"; font-size: 12pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"> <span style="font-family: "Courier New", Courier, monospace; font-size: x-small;">reply.Update();</span></span></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-52072829528681218082011-06-01T02:59:00.000-07:002011-06-01T03:00:39.466-07:00Virto Bulk Upload<div dir="ltr" style="text-align: left;" trbidi="on"><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -0.25in;"><span style="color: #525252; font-family: Wingdings; font-size: 8pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-bidi-font-weight: bold; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">Site gets updated with </span><span style="color: #525252; font-family: "Verdana", "sans-serif"; font-size: 8pt; mso-fareast-font-family: "Times New Roman";">Virto Bulk File Upload Web Part for SharePoint 2010, Ribbon Item for the lists to Attach Multiple Files </span><span style="color: #1f497d; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">a</span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">nd</span><span style="color: #525252; font-family: "Verdana", "sans-serif"; font-size: 8pt; mso-fareast-font-family: "Times New Roman";"> ECB Action Item for the lists to Attach Multiple Files.</span></h3><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-imynP9wII7w/TeYMwX93m9I/AAAAAAAADJE/wD5zVW-Wmdk/s1600/virto1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="182" src="http://2.bp.blogspot.com/-imynP9wII7w/TeYMwX93m9I/AAAAAAAADJE/wD5zVW-Wmdk/s400/virto1.jpg" t8="true" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-i3lO3-jLWqo/TeYNK6PkhYI/AAAAAAAADJI/LiVe_lYnbxc/s1600/virto2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="222" src="http://4.bp.blogspot.com/-i3lO3-jLWqo/TeYNK6PkhYI/AAAAAAAADJI/LiVe_lYnbxc/s400/virto2.jpg" t8="true" width="400" /></a></div><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">From the web part properties we can choose the any choose the site and then Bulk Upload or Attach Multiple Files.</span></h3><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">If we choose Bulk Upload we get an option to choose single document library for uploading multiple files.</span></h3><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">If we choose Attach Multiple Files we get an option to choose List and single list Item for attaching multiple files to the selected list item. </span></h3><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">If we have any required fields it gives an alert.</span></h3><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">We can edit the metadata for single item or for all the items at a time</span></h3><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-BF7y1qYNM0s/TeYNZc1_TUI/AAAAAAAADJM/8Ibfk4I0KoA/s1600/virto3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="http://1.bp.blogspot.com/-BF7y1qYNM0s/TeYNZc1_TUI/AAAAAAAADJM/8Ibfk4I0KoA/s400/virto3.jpg" t8="true" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-CirgG6hzpN8/TeYNcgRjIaI/AAAAAAAADJQ/oCzHYWpfvZE/s1600/virto4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://3.bp.blogspot.com/-CirgG6hzpN8/TeYNcgRjIaI/AAAAAAAADJQ/oCzHYWpfvZE/s400/virto4.jpg" t8="true" width="282" /></a></div><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";"></span> </h3><h3 style="margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";"></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; mso-fareast-font-family: "Times New Roman";">Drawbacks:</span></h3><h3 style="margin: 0in 0in 0pt 0.75in; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">At a time we cannot upload to 2 document libraries. Every time we should change the web part properties for uploading into different list/library</span></h3><h3 style="margin: 0in 0in 0pt 0.75in; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">If we have any </span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; mso-fareast-font-family: "Times New Roman";">Managed Meta Data field type as column as required field</span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">, this field is not showing in the Properties screen. As it is a required field we are not able to upload single item to that library.</span></h3><h3 style="margin: 0in 0in 0pt 0.75in; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">Under Web Part properties it has an option to enter </span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; mso-fareast-font-family: "Times New Roman";">Redirect Url. </span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">I didn’t find any use of this value.</span></h3><h3 style="margin: 0in 0in 0pt 0.75in; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -0.25in;"><span style="color: #1f497d; font-family: Wingdings; font-size: 11pt; font-weight: normal; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">Ø<span style="font-family: "Times New Roman";"> </span></span></span><span style="color: #1f497d; font-family: "Calibri", "sans-serif"; font-size: 11pt; font-weight: normal; mso-fareast-font-family: "Times New Roman";">After uploading it will not show any message like uploaded successfully.</span></h3></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-40299431438911692452011-06-01T02:37:00.000-07:002011-06-01T02:41:48.101-07:00Delegate Control<div dir="ltr" style="text-align: left;" trbidi="on"><div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: Arial, Helvetica, sans-serif;">The Delegate Controls comes into picture when want to brand a SharePoint Site. The delegate control acts like a container control which encapsulates default content (set of child controls inside it). The default content (set of child controls associated with delegate) can be substituted by a specific control, by creating a feature. The ability to override or substitute the delegate controls brings the power & flexibility to brand SharePoint Sites.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">The out-of-box SharePoint Foundation Master Page defines many controls like Top Navigation Data Source, Left Navigation Data Source, Search Box and Additional Page Head etc as delegate controls. The list is illustrated below :-</span><br />
<pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ControlId</span><span class="kwrd">="AdditionalPageHead"</span> <span class="attr">AllowMultipleControls</span><span class="kwrd">="true"</span><span class="kwrd">/></span></pre><pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ControlId</span><span class="kwrd">="GlobalNavigation"</span> <span class="kwrd">/></span></pre><pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ID</span><span class="kwrd">="GlobalDelegate0"</span> <span class="attr">ControlId</span><span class="kwrd">="GlobalSiteLink0"</span> <span class="kwrd">/></span></pre><pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">ControlId</span><span class="kwrd">="GlobalSiteLink2"</span> <span class="attr">ID</span><span class="kwrd">="GlobalDelegate2"</span> <span class="attr">Scope</span><span class="kwrd">="Farm"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/></span></pre><pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ControlId</span><span class="kwrd">="PublishingConsole"</span> <span class="attr">Id</span><span class="kwrd">="PublishingConsoleDelegate" /</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">ControlId</span><span class="kwrd">="GlobalSiteLink3"</span> <span class="attr">Scope</span><span class="kwrd">="Farm"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/></span></pre><pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ControlId</span><span class="kwrd">="SmallSearchInputBox"</span> <span class="attr">Version</span><span class="kwrd">="4"</span> <span class="kwrd">/></span></pre><pre class="csharpcode"><span class="kwrd"><</span><span class="html">SharePoint:DelegateControl</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ControlId</span><span class="kwrd">="TopNavigationDataSource"</span> <span class="attr">Id</span><span class="kwrd">="topNavigationDelegate"</span><span class="kwrd">/></span>
<span style="font-family: Arial, Helvetica, sans-serif;">The above listed delegate controls can be substituted at runtime to achieve custom branding. Or else we can create our own delegate and we can add to our master page.</span></pre><span style="font-family: Arial;"><span style="font-family: "Courier New", Courier, monospace;"><SharePoint:DelegateControl ControlId="TimeZoneDelegate" runat="server"/></span></span><br />
<br />
<strong><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial;">Steps to create DelegateControl:</span></span></strong><br />
<ol style="text-align: left;"><li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial;">File -> New Project -> SharePoint Empty Project.</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial;">Add New Class and change its base class to <span class="selflink" xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: "Courier New", Courier, monospace;">System.Web.UI.WebControls<span xmlns="">.</span>WebControl </span></span></span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial;"><span class="selflink" xmlns="http://www.w3.org/1999/xhtml">Override required methods like <span style="font-family: "Courier New", Courier, monospace;">OnLoad</span>,<span style="font-family: "Courier New", Courier, monospace;">CreateChildControls</span> or <span style="font-family: "Courier New", Courier, monospace;">Render</span>. </span></span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial;"><span class="selflink" xmlns="http://www.w3.org/1999/xhtml">Add New Module with <span style="font-family: "Courier New", Courier, monospace;">Elements.xml </span><span style="font-family: Arial, Helvetica, sans-serif;">and add the below tag. add the safe control entry as well.</span></span></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial;"><span class="selflink" xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: "Courier New", Courier, monospace;"><Control Id="TimeZoneDelegate" Sequence="100" ControlClass="addedclassFullName" ControlAssembly="$SharePoint.Project.AssemblyFullName$" ></Control></span></span> </span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Instead of adding a class we can use an UserControl and refer it in ControlSrc property of Control tag in place of ControlClass and ControlAssembly.</span></li>
<li><span style="font-family: Arial;">Deploy the feature.</span></li>
</ol></div></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-11372059455312525322011-05-27T03:16:00.001-07:002011-05-27T03:16:33.794-07:00Hide First Tab(Home) in SharePoint 2010 Navigation<div dir="ltr" style="text-align: left;" trbidi="on">You will notice that the Home tab actually is the first node and then has a child UL which represents the rest of the navigation Items. So the approach is to hide the first <li> <a> (display: none) and then simply just use (display:block ) to show the hidden <ul> <li> <a> tags. <br />
Here is the CSS you could use to hide just the first node (home) tab in a SharePoint 2010 application:<br />
<strong>.s4-tn li.static > a{ <br />
display: none !important; <br />
} <br />
.s4-tn li.static > ul a{ <br />
display: block !important; <br />
}</strong></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-20594106051773448882011-05-27T03:04:00.000-07:002011-05-27T03:04:56.241-07:00Changes in SharePoint Designer are not gettings saved<div dir="ltr" style="text-align: left;" trbidi="on">If we do any xslt modifications for XSLT List View WebParts, those changes wont get reflected in the UI but you can observe those changes in the design mode. To resolve this issue search for <span style="color: red;">ddwrt:ghost="hide"</span> and remove. </div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-87892600298544503992011-05-27T03:01:00.000-07:002011-05-27T03:12:18.601-07:00Regional Settings<div dir="ltr" style="text-align: left;" trbidi="on">User can specify the regional settings from his My settings section. If he didnt specify system will take the current web regional settings.<br />
<strong>Object Model:</strong><br />
<span style="color: #2b91af; font-family: Consolas; font-size: x-small;"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;">SPRegionalSettings <span style="color: black;">regionalSettings;</span><br />
SPUser<span style="font-family: Consolas; font-size: x-small;"><span style="color: black; font-family: Consolas; font-size: x-small;"> user = </span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;">SPContext</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="color: black; font-family: Consolas; font-size: x-small;">.Current.Web.CurrentUser;</span></span><br />
regionalSettings = user.RegionalSettings;<br />
<span style="color: blue;">if</span><span style="font-family: Consolas; font-size: x-small;"><span style="color: black; font-family: Consolas; font-size: x-small;"> (regionalSettings != </span></span><span style="color: blue; font-family: Consolas; font-size: x-small;"><span style="color: blue; font-family: Consolas; font-size: x-small;"><span style="color: blue; font-family: Consolas; font-size: x-small;">null</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="color: black; font-family: Consolas; font-size: x-small;">)</span></span><br />
{<br />
lblTimeZone.Text = regionalSettings.TimeZone.Description;<br />
}</span></span></span><span style="color: blue; font-family: Consolas; font-size: x-small;"><span style="color: blue; font-family: Consolas; font-size: x-small;"><span style="color: blue; font-family: Consolas; font-size: x-small;">else</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">{<br />
regionalSettings=<span style="color: #2b91af;">SPContext</span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">.Current.Web.RegionalSettings;</span></span><br />
lblTimeZone.Text = regionalSettings.TimeZone.Description;<br />
}</span></span><br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-jITfDn6kHfY/Td92SRzGTsI/AAAAAAAADI4/YtPnuLZlBCo/s1600/settings.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-jITfDn6kHfY/Td92SRzGTsI/AAAAAAAADI4/YtPnuLZlBCo/s1600/settings.jpg" t8="true" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-vHn_9q6DJyI/Td92V68BELI/AAAAAAAADI8/JQOxo1lknh4/s1600/settings2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-vHn_9q6DJyI/Td92V68BELI/AAAAAAAADI8/JQOxo1lknh4/s1600/settings2.jpg" t8="true" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-I79TCkNkO0g/Td92Ys4EJXI/AAAAAAAADJA/quo69tEIoEs/s1600/settings3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="165" src="http://3.bp.blogspot.com/-I79TCkNkO0g/Td92Ys4EJXI/AAAAAAAADJA/quo69tEIoEs/s400/settings3.jpg" t8="true" width="400" /></a></div></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-32454954404197025872011-04-25T05:39:00.001-07:002011-04-25T05:39:49.139-07:00To remove the particular Content type from New Menu<div dir="ltr" style="text-align: left;" trbidi="on"><span style="color: black;"><strong>SPList list = web.Lists[</strong><em><List Name></em></span><span style="color: black;"><strong>];<br />
<br />
IList<SPContentType> ctoFolder = list.RootFolder.UniqueContentTypeOrder;<br />
<br />
for (int i = ctoFolder.Count -1; i >= 0; i--)<br />
{<br />
if (ctoFolder[i].Name == </strong><em><Content Type Name></em></span><strong><span style="color: black;">)<br />
{ <br />
ctoFolder.Remove(ctoFolder[i]); <br />
}<br />
}</span></strong><br />
<strong><span style="color: black;"> list.RootFolder.UniqueContentTypeOrder = ctoFolder;<br />
list.RootFolder.Update();</span></strong></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-12065953401814286692011-04-25T05:21:00.000-07:002011-04-25T05:21:13.214-07:00Convert string to Color object in SilverLight<div dir="ltr" style="text-align: left;" trbidi="on"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt 1in; mso-layout-grid-align: none;"><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">Color</span><span style="font-family: Consolas; font-size: 9.5pt;"> c;</span></div><div class="MsoNormal" style="line-height: normal; 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;">Type</span> colorType = (<span style="color: blue;">typeof</span>(System.Windows.Media.<span style="color: #2b91af;">Colors</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> (colorType.GetProperty(slist.color) != <span style="color: blue;">null</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></div><div class="MsoNormal" style="line-height: normal; 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;">object</span> o = colorType.InvokeMember("Red", <span style="color: #2b91af;">BindingFlags</span>.GetProperty, <span style="color: blue;">null</span>, <span style="color: blue;">null</span>, <span style="color: blue;">null</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> (o != <span style="color: blue;">null</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></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>c = (<span style="color: #2b91af;">Color</span>)o;</span></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>c = <span style="color: #2b91af;">Colors</span>.Black;</span></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas; font-size: 9.5pt;"><span style="mso-spacerun: yes;"> </span>c = <span style="color: #2b91af;">Colors</span>.Black;</span></div><div class="MsoNormal" style="line-height: normal; 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></div><div class="MsoNormal" style="line-height: normal; 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;">Brush</span> color = <span style="color: blue;">new</span> <span style="color: #2b91af;">SolidColorBrush</span>(c);<span style="mso-spacerun: yes;"> </span></span></div></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-24572453105893587702011-04-25T05:18:00.001-07:002011-04-25T05:19:37.410-07:00Stsadm Import and Export commands<div dir="ltr" style="text-align: left;" trbidi="on"><div class="MsoListParagraphCxSpFirst" style="background: white; line-height: 18pt; margin: 0.2in 0in 0.2in 0.75in; mso-add-space: auto;"><div style="text-align: left;"><span style="color: #333333; font-family: "Verdana", "sans-serif"; font-size: 9.5pt; mso-bidi-font-family: "Lucida Sans Unicode"; mso-fareast-font-family: "Times New Roman";">stsadm –o export –url htpp://URL –filename E:\backup\test.cab –includeusersecurity –versions 4 –cabsize 1024 –nofilecompression </span></div></div><div class="MsoListParagraphCxSpLast" style="background: white; line-height: 18pt; margin: 0.2in 0in 0.2in 0.75in; mso-add-space: auto; text-align: left;"><span style="color: #333333; font-family: "Verdana", "sans-serif"; font-size: 9.5pt; mso-bidi-font-family: "Lucida Sans Unicode";">stsadm –o import –url htpp://URL –filename E:\backup\test.cab –includeusersecurity –updateversions 3 –nofilecompression</span><span style="color: #333333; font-family: "Lucida Sans Unicode", "sans-serif"; font-size: 9.5pt; mso-fareast-font-family: "Times New Roman";"></span></div></div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0tag:blogger.com,1999:blog-5444579294730972266.post-90927633398919459642011-04-25T05:07:00.000-07:002011-04-25T05:07:51.205-07:00Clearing the People Picker Control<div dir="ltr" style="text-align: left;" trbidi="on">For clearing the People Picker Control we should first clear its Accounts and then entities then only it will clear. If you do it in the reverse way or miss any of one it wont work.<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 0pt 67.5pt;"><span style="font-family: "Courier New"; font-size: 10pt;">WSOwner.Accounts.Clear();</span></div><div class="MsoNormal" style="margin: 0in 0in 0pt 67.5pt;"><span style="font-family: "Courier New"; font-size: 10pt;">WSOwner.Entities.Clear();</span></div>[WSOwner represents peoplepicker object]</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com1tag:blogger.com,1999:blog-5444579294730972266.post-11964312531005249682011-04-25T05:01:00.000-07:002011-04-25T05:01:27.426-07:00Application Pool ID<div dir="ltr" style="text-align: left;" trbidi="on">For knowing the application pool ID we should run the <strong>iisapp </strong>command using command prompt in SharePoint 2007. <br />
The above mentioned command wont work for SharePoint 2010. We should use<br />
<span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;"><strong>%windir%\system32\inetsrv\appcmd.exe list wp</strong><span style="mso-spacerun: yes;"> </span></span><br />
</div>Jyothsnahttp://www.blogger.com/profile/09168294665456726257noreply@blogger.com0