asp.net内容中的concat变量

时间:2015-02-06 12:38:44

标签: c# asp.net sharepoint

我有一个asp.net组件:

<SearchWC:ContentBySearchWebPart QueryGroupName="HashTag_TagFeed" id="CERNTagFeed" runat="server" FrameType="None" ResultsPerPage=10 
            ShouldHideControlWhenEmpty="true" RenderTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/System/Control_TagFeed.js" 
            AvailableSortsJson="[{'name':'LastModifiedTime','sorts':[{'p':'LastModifiedTime','d':1}]}]"
            SelectedPropertiesJson="[&quot;PublishingImage&quot; , &quot;PictureURL&quot; , &quot;PictureThumbnailURL&quot; , &quot;Title&quot;, &quot;FullPostAuthor&quot;, &quot;Path&quot;, &quot;Description&quot;, &quot;LastModifiedTime&quot;, &quot;CollapsingStatus&quot;, &quot;Created&quot;, &quot;HitHighlightedSummary&quot;, &quot;HitHighlightedProperties&quot;, &quot;ParentLink&quot;, &quot;AttachmentDescription&quot;, &quot;AttachmentType&quot;, &quot;AttachmentURI&quot;, &quot;RootPostID&quot;, &quot;ReplyCount&quot;, &quot;LikesCount&quot;, &quot;FullPostBody&quot;]" 
            ItemTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Microblog.js"
            GroupTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Group_Content.js"
            DataProviderJson= --here should go DPJSON --
        />

在DataProviderJson中,我想插入一个变量,在这里定义:

<script type="text/c#" runat="server">
    string foo = "bar";
    static SPSite site = new SPSite(SPContext.Current.Web.Url);
    static TaxonomySession taxonomySession = new TaxonomySession(site);
    static TermStore termStore = taxonomySession.DefaultKeywordsTermStore;
    string associatedTerms;
    static Term term = termStore.GetTerm(new Guid(HttpContext.Current.Request.Params["TermID"]));
    static string test = term.Name;
    //term.CustomProperties.TryGetValue("_Sys_HashAssoc", out associatedTerms);
    //static string test = term.Name;


    static string dpjson = "test value";

</script>

我该怎么做?

0 个答案:

没有答案