我的单词vsto加载项中有以下ribbon.xml:
<tab id="TabLetters" getVisible="IsLettersTabVisible" label="Letters">
<group id="LettersGroup" label="Letters">
<toggleButton id="NewWithTemplate"
label="New using template Controls"
size="large"
imageMso="FileNew"
onAction="NewTemplated" />
</toggleButton>
</group>
</tab>
Run Code Online (Sandbox Code Playgroud)
以及click事件背后的代码:
public void NewTemplated(Office.IRibbonControl control, bool value)
{
CloseDocument();
var doc = Globals.ThisAddIn.Application.Documents.Add(Template: @"LETTER_V2.dotx", Visible: true);
doc.Activate();
_ribbon.ActivateTab("TabLetters");
}
Run Code Online (Sandbox Code Playgroud)
我希望这会导致我的功能区选项卡打开一个新窗口,但它仍然是可见/当前的HOME选项卡.如何让我的标签显示出来?
我在_Layout.cshtml文件中有以下代码.我的想法是在我的javascript代码中填写了一些关于安全性的项目.LoggedIn和用户名显然没有问题,但是角色放在javascript中的方式是错误的.角色只是一个字符串[](应该成为一个JSON数组.
但它显示为"[""用户","管理员"],显然不是有效的JSON数组.我有什么想法可以将我的字符串数组转换为有效的JSON数组?我在下面添加了RolesArray的代码.
<script type="text/javascript">
$(function () {
require(['jquery','config', 'security'],
function ($, config, security) {
security.items.loggedIn = '@Request.IsAuthenticated';
security.items.Username = '@User.Identity.Name';
var one = '@((MyIdentity)User.Identity).RolesArray'
$(document).trigger("security_changed");
});
});
</script>
public String[] RolesArray
{
get
{
var two = Roles.ToArray();
return two;
}
}
Run Code Online (Sandbox Code Playgroud) 我有一些同事已经建立了WCF服务.他们的安全设置如下:
security mode="None"
transport clientCredentialType="Windows" proxyCredentialType="None" realm=""
message clientCredentialType="Windows" negotiateServiceCredential="true"
establishSecurityContext="true"
security
Run Code Online (Sandbox Code Playgroud)
指定安全模式="无"然后在下面指定传输/消息安全性是否有意义?