如何以编程方式向母版页中的字段添加值 [英] How can I add a value to a field in the masterpage programmatically
问题描述
我不确定要使用哪种SharePoint工件来完成此任务.我认为Web部件可以解决问题,但我想向这里的专家咨询.
I'm not sure what kind of SharePoint artifact to use in order to accomplish this. I am thinking a web part will do the trick but thought I'd ask the experts here for advice.
我需要运行一些服务器端代码,以使AD组当前用户并将其放入母版页的字段中.此信息将用于在页面上显示不同的元素.该字段将不会显示,但会显示 需要通过JavaScript进行访问.
I need to run some server side code that will get the AD groups that the current user and put it into a field on the master page. This information will be used to display different elements on a page. The field will not be displayed but will need to be accessible by JavaScript.
感谢您的光临!
全爱他们...不管. -佛陀
Love them all...regardless. - Buddha
推荐答案
您需要创建母版页(使用.master文件,其代码位于file后面)从头开始.请检查此链接以开始进行总体设计.
You need to create the master page (with .master file with code behind file )from the scratch. Please check this link to start the master design.
在文件后面的代码中,在AD后面编写用户检索逻辑.
In code behind file write your user retrieving logic behind AD.
这篇关于如何以编程方式向母版页中的字段添加值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!