Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

How to make aClaims Viewer WebPart for SP 2013

$
0
0

I have tried to modify existing examples for SP2010 like this:

  1. using System;
  2. using System.Web.UI;
  3. using System.Web.UI.WebControls;
  4. using System.Web.UI.WebControls.WebParts;
  5. using System.Security.Claims
  6. namespace ClaimsViewerTest.VisualWebPart1
  7. {
  8. publicpartialclassVisualWebPart1UserControl :UserControl
  9. {
  10. protectedvoid Page_Load(object sender,EventArgs e)
  11. {
  12. ClaimsPrincipal claimsPrincipal = Page.UserasClaimsPrincipal;
  13. ClaimsIdentity claimsIdentity = (ClaimsIdentity)claimsPrincipal.Identity;
  14. GridView1.DataSource = claimsIdentity.Claims;
  15. Page.DataBind();
  16. }
  17. }
  18. }

But then I get object reference not set... when trying to add the webpart in SP2013.

I have also tried instructions on http://blog.helloitsliam.com/Lists/Posts/Post.aspx?ID=80

but then I get assembly generation failed. Referenced assembly ...... does not have a strong name.

If someone could point me to how I can construct the code properly I would be must grateful as a newbie in SP development.


Viewing all articles
Browse latest Browse all 25064

Trending Articles



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