简体   繁体   English

如何覆盖 Upload.aspx 或 AllItems.aspx 等 SharePoint 2013(不是 SP 设计器)

[英]How can you override Upload.aspx or AllItems.aspx etc. SharePoint 2013 (NOT SP Designer)

Does anyone know how to override the code that is executed when a user clicks on "new item".有谁知道如何覆盖用户单击“新项目”时执行的代码。 I want to use a custom template / code, so the user will not have to upload the new file each time the person will create a new document.我想使用自定义模板/代码,因此用户每次创建新文档时都不必上传新文件。 Simply skip this section and upload the template file in code behind.只需跳过本节并在后面的代码中上传模板文件。 All of this must bee done in cod, so it can work in every SP solutions.所有这些都必须在 cod 中完成,因此它可以在每个 SP 解决方案中工作。 Thanks!谢谢!

I'm not 100% sure about this, but with previous versions, you were able to define custom content types , add them to a doc lib and then choose the template as new item.我对此不是 100% 确定,但是在以前的版本中,您可以定义自定义内容类型,将它们添加到文档库,然后选择模板作为新项目。

maybe you want to take a look at this: http://www.learningsharepoint.com/2013/04/21/how-to-create-a-content-type-in-sharepoint-2013/也许你想看看这个: http : //www.learningsharepoint.com/2013/04/21/how-to-create-a-content-type-in​​-sharepoint-2013/

regarding your attempt to directly manipulate sharepoint internal code, that's not possible since microsoft doesn't allow usercode in core components .关于您尝试直接操作sharepoint内部代码的尝试,这是不可能的,因为microsoft 不允许在核心组件中使用用户代码

maybe you want to create a webpart with a "new item"-button, which of course allows usercode.也许你想创建一个webpart有一个“新项目”按钮上,这当然允许用户代码。 On click you create a new item, upload the template and redirect to the doclib. On click您创建一个新项目,上传模板并重定向到 doclib。

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

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