Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

How to Set default value for taxonomywebtagging control with terms and nested terms

$
0
0

Hi,

I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.

Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?

Any help would be greatly apprecited.

Control code in aspx page:

<td><asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label></td><td><Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" />

</td>

Mapping metedata code:

TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
                //Set the Business Unit Field
                SPSite site = SPContext.Current.Web.Site;
                TermStore termStore = session.TermStores["Managed Metadata Service"];
                Group group = termStore.Groups["GROUPName"];
                TermSet termSet = group.TermSets["TERMSETNAME"];
                Term term = termSet.Terms["TermA"];
                Guid termGuid = term.Id;
term.SspId.Add(termStore.Id);
                term.TermSetId.Add(termSet.Id);
                term.AllowFillIn = true;
                term.AnchorId = countryGuid;
                term.IsMulti = true;

 

 

 

Thank you.

AA.






Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>