1

I have file ASCX and there is this:

<SharePoint:RenderingTemplate ID="DocumentLibraryForm" runat="server">
  <Template>
    <Sharepoint:PeopleEditor runat="server" ID="User1" />
 </Template>
</SharePoint:RenderingTemplate>

And I cant access to User1 in cs file, any idea? I can't just write User1, my code dont know what is this. This file I make as custom form for my list in sharepoint.

  • you didn't gave much context to the question, so I can't really say if this is expected or a bug... But if you don't "see" the control in your .cs codebehind file, it means that the field isn't defined in the code. Maybe the desiger file isn't updating for some reason (assuming you have one)? And be aware that there are situations when you probably will end up without an auto-generated designer: in that case you should add the field instance manually to your .cs file. – Hitodama Oct 14 '16 at 17:45
  • Yes, I cant see User1 in code behind in cs file. Dont know why? If put PeopleEditor after RenderingTemplate, I can see it behin code in cs file. – Rhonin Oct 14 '16 at 17:50
  • Didn't notice your control was in a rendering template at first, sorry. Will have to check if you can access controls in a template that way, I will try to update you back if I can find something useful. – Hitodama Oct 14 '16 at 18:01
  • I dont have this code now, but I remember asp:button I can see... so... Something wrong with Sharepoint controllers? – Rhonin Oct 14 '16 at 18:03
0

I got my answer. http://selingernetwork.com/blog/?p=7 I did like there was written and it works :) Just like i wanted. Just add new ascx (not template) to the template of sharepoint. Its just you dont have access to the behind code from template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.