简体   繁体   English

ASP.NET MVC应用程序中的人员选取器控件实现

[英]People picker control implementation in asp.net mvc application

I want to include the Sharepoint people picker control type in my application, My app is developed in asp.net MVC. 我想在我的应用程序中包括Sharepoint人员选择器控件类型,我的应用程序是在asp.net MVC中开发的。 is there a way so that i can include the GAL feature in my asp.net application. 有没有办法让我可以在我的asp.net应用程序中包括GAL功能。 This should work even if the outlook is not installed in user pc. 即使未在用户PC中安装Outlook,这也应该起作用。

Taken from this page dated March 1 2013 摘自2013年3月1日的本页

"SP controls can only be used on SP hosted pages. Currently the only control designed from the ground up to be consumed on all page types (provider-hosted, auto-hosted or sp hosted) is the chrome control." “ SP控件只能在SP托管页面上使用。chrome控件是目前从头开始设计并在所有页面类型(提供商托管,自动托管或sp托管)上使用的唯一控件。”

and another post from an MSFT 以及MSFT的另一篇文章

"I've consulted with several colleagues and the consensus seems to be that SharePoint's client side people picker, which is JavaScript, cannot be used in a provider-hosted app. The reason is that there's no way to get a client context on a remote web page. You mention the TokenHelper.cs which is managed code, not JavaScript. I have a question pending with the product team to see if there's anyway to get the context with managed code and pass it to JavaScript. I didn't want you to have to wait any longer for an answer." “我已经咨询了几位同事,协商一致似乎是SharePoint的客户端选择器(即JavaScript)无法在提供商托管的应用程序中使用。原因是无法在远程环境中获得客户端上下文。 Web页面上,您提到的是TokenHelper.cs,它是托管代码,而不是JavaScript。我有一个与产品团队一起待解决的问题,以查看是否有通过托管代码获取上下文并将其传递给JavaScript的方法。不得不再等待一个答案。”

I would suggest writing a plugin. 我建议写一个插件。 (Although I have never had the requirement to implement it YET) (尽管我从来没有要求实施它)

How : 怎么样 :

you write a controller that loads users from AD, and then send a JSON object of these to your client via AJAX and then use jquery auto complete to filter names as the user types. 您编写了一个从AD加载用户的控制器,然后通过AJAX将这些用户的JSON对象发送到您的客户端,然后使用jquery autocomplete过滤用户名作为用户类型。

Or 要么

Simulate the "check User " button by making AJAX calls to that controller and check if name exist on click of that button. 通过对该控制器进行AJAX调用来模拟“检查用户”按钮,并在单击该按钮时检查名称是否存在。 then write appropriate error messages if false. 如果错误,则编写相应的错误消息。

I would still be on the lookout for other solutions though 我仍然会寻找其他解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM