SharePoint 自定义列表编辑页面,附件上传提示“此表单自定义为不处理附件”
自定义SharePoint列表的编辑页面,在点“附加文件”链接时,提示“此表单自定义为不处理附件”,原来是由于自定义的ListForm模板中缺少<span id="part1">这个标记,在编辑页面的代码中补充进去,最后的效果如下:
1 <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Edit.ascx.cs" Inherits="ITSCustomMgr.UserControls._12.TEMPLATE.LAYOUTS.ITSPages.Custom.ITSICGeneralProject.Edit" %>
2 <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
3 <%@ Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
4 Namespace="Microsoft.SharePoint.WebControls" %>
5 <SharePoint:FormToolBar ID="FormToolBar1" runat="server" />
6 <SPAN id='part1'>
7 <table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" cellspacing="0"
8 width="100%">
9 <table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" cellspacing="0"
10 width="100%">
11 <tr>
12 <td nowrap="true" valign="top" width="400" class="ms-formlabel" colspan="2" style="width: 590px">
13 <span class="ms-formvalidation">*请添加项目报备表</span>
14 </td>
15 </tr>
16 <tr>
17 <td nowrap="true" valign="top" width="400" class="ms-formlabel">
18 <h3 class="ms-standardheader">
19 <nobr>客户名称<span class="ms-formvalidation">*</span></nobr>
20 </h3>
21 </td>
22 <td valign="top" class="ms-formbody" width="400">
23 <asp:DropDownList ID="DdlCustomName" runat="server" Enabled="false">
24 </asp:DropDownList>
25 <asp:Label ID="LabCustomName" runat="server" ForeColor="Red" Visible="False" Font-Size="9pt"
26 Width="50%" Height="16px"></asp:Label>
27 </td>
28 </tr>
29 <tr>
30 <td nowrap="true" valign="top" width="400" class="ms-formlabel">
31 <h3 class="ms-standardheader">
32 <nobr>项目名称<span class="ms-formvalidation">*</span></nobr>
33 </h3>
34 </td>
35 <td valign="top" class="ms-formbody" width="400">
36 <asp:TextBox ID="TBTitle" runat="server" Enabled="false" CssClass="ms-long"></asp:TextBox>
37 </td>
38 </tr>
39 <tr>
40 <td nowrap="true" valign="top" class="ms-formlabel">
41 <h3 class="ms-standardheader">
42 <nobr>项目状态<span class="ms-formvalidation">*</span></nobr>
43 </h3>
44 </td>
45 <td valign="top" class="ms-formbody">
46 <SharePoint:FormField FieldName="ProjectState" ID="ProjectState" runat="server">
47 </SharePoint:FormField>
48 </td>
49 </tr>
50 <tr>
51 <td>
52 <SharePoint:FormComponent ID="FormComponent1" TemplateName="AttachmentRows" runat="server" />
53 </td>
54 </tr>
55 </table>
56 <br />
57 <table class="ms-formtoolbar" cellpadding="2" cellspacing="0" border="0" width="100%">
58 <tr>
59 <td width="95%" class="ms-toolbar" nowrap>
60 <img src="/_layouts/images/blank.gif" width="1" height="18" alt="">
61 </td>
62 <td class="ms-toolbar" nowrap="true">
63 <asp:Button ID="ReSubmit" runat="server" Text="重新提交"
64 class="ms-ButtonHeightWidth" target="_self" onclick="ReSubmit_Click" Visible="false" />
65 </td>
66 <td class="ms-separator">
67
68 </td>
69 <td class="ms-toolbar" nowrap="true">
70 <asp:Button ID="BtnOk" runat="server" Text="保存" class="ms-ButtonHeightWidth"
71 target="_self" onclick="BtnOk_Click" />
72 </td>
73 <td class="ms-separator">
74
75 </td>
76 <td class="ms-toolbar" nowrap="true">
77 <asp:Button ID="BtnCancle" runat="server" Text="取消" AccessKey="C"
78 class="ms-ButtonHeightWidth" target="_self"
79 onclick="BtnCancle_Click" />
80 </td>
81 </tr>
82 </table>
83 </SPAN>
84 <SharePoint:AttachmentUpload ID="AttachmentUpload1" runat="server"/>
2 <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
3 <%@ Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
4 Namespace="Microsoft.SharePoint.WebControls" %>
5 <SharePoint:FormToolBar ID="FormToolBar1" runat="server" />
6 <SPAN id='part1'>
7 <table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" cellspacing="0"
8 width="100%">
9 <table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" cellspacing="0"
10 width="100%">
11 <tr>
12 <td nowrap="true" valign="top" width="400" class="ms-formlabel" colspan="2" style="width: 590px">
13 <span class="ms-formvalidation">*请添加项目报备表</span>
14 </td>
15 </tr>
16 <tr>
17 <td nowrap="true" valign="top" width="400" class="ms-formlabel">
18 <h3 class="ms-standardheader">
19 <nobr>客户名称<span class="ms-formvalidation">*</span></nobr>
20 </h3>
21 </td>
22 <td valign="top" class="ms-formbody" width="400">
23 <asp:DropDownList ID="DdlCustomName" runat="server" Enabled="false">
24 </asp:DropDownList>
25 <asp:Label ID="LabCustomName" runat="server" ForeColor="Red" Visible="False" Font-Size="9pt"
26 Width="50%" Height="16px"></asp:Label>
27 </td>
28 </tr>
29 <tr>
30 <td nowrap="true" valign="top" width="400" class="ms-formlabel">
31 <h3 class="ms-standardheader">
32 <nobr>项目名称<span class="ms-formvalidation">*</span></nobr>
33 </h3>
34 </td>
35 <td valign="top" class="ms-formbody" width="400">
36 <asp:TextBox ID="TBTitle" runat="server" Enabled="false" CssClass="ms-long"></asp:TextBox>
37 </td>
38 </tr>
39 <tr>
40 <td nowrap="true" valign="top" class="ms-formlabel">
41 <h3 class="ms-standardheader">
42 <nobr>项目状态<span class="ms-formvalidation">*</span></nobr>
43 </h3>
44 </td>
45 <td valign="top" class="ms-formbody">
46 <SharePoint:FormField FieldName="ProjectState" ID="ProjectState" runat="server">
47 </SharePoint:FormField>
48 </td>
49 </tr>
50 <tr>
51 <td>
52 <SharePoint:FormComponent ID="FormComponent1" TemplateName="AttachmentRows" runat="server" />
53 </td>
54 </tr>
55 </table>
56 <br />
57 <table class="ms-formtoolbar" cellpadding="2" cellspacing="0" border="0" width="100%">
58 <tr>
59 <td width="95%" class="ms-toolbar" nowrap>
60 <img src="/_layouts/images/blank.gif" width="1" height="18" alt="">
61 </td>
62 <td class="ms-toolbar" nowrap="true">
63 <asp:Button ID="ReSubmit" runat="server" Text="重新提交"
64 class="ms-ButtonHeightWidth" target="_self" onclick="ReSubmit_Click" Visible="false" />
65 </td>
66 <td class="ms-separator">
67
68 </td>
69 <td class="ms-toolbar" nowrap="true">
70 <asp:Button ID="BtnOk" runat="server" Text="保存" class="ms-ButtonHeightWidth"
71 target="_self" onclick="BtnOk_Click" />
72 </td>
73 <td class="ms-separator">
74
75 </td>
76 <td class="ms-toolbar" nowrap="true">
77 <asp:Button ID="BtnCancle" runat="server" Text="取消" AccessKey="C"
78 class="ms-ButtonHeightWidth" target="_self"
79 onclick="BtnCancle_Click" />
80 </td>
81 </tr>
82 </table>
83 </SPAN>
84 <SharePoint:AttachmentUpload ID="AttachmentUpload1" runat="server"/>
这样,问题就解决了。