

當系統標識為用戶自定義的時候修改刪除可編輯,否則不可編輯!由於設置權限問題,所有在gridview控件中有一個系統標識的掩藏列:
<Columns>
<asp:TemplateField>
<ItemTemplate>
<input type="checkbox" id="ckvalue" <%#Eval("Function_IsSys").ToString() == "2"? " " :"disabled='disabled'" %> name="ckvalue" value='<%# Eval("Function_ID") %>' /></ItemTemplate>
<HeaderTemplate>
<input type="checkbox" id="ckall" name="ckall" disabled="disabled" onclick="CheckAll(this.checked,'ckvalue')" /></HeaderTemplate>
<ItemStyle HorizontalAlign="Center" Width="5%" />
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField HeaderStyle-CssClass="display" ItemStyle-CssClass="display" DataField="Function_IsSys" />
<asp:TemplateField HeaderText="功能編碼">
<ItemTemplate>
<%--<a href="javascript:location.href='UserInfoView.aspx?id=<%# Eval("Function_NO") %>'" title="詳細">--%><%# Eval("Function_NO")%></a>
</ItemTemplate>
<HeaderStyle Font-Bold="False" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField HeaderText="功能名稱" DataField="Function_Name">
<HeaderStyle HorizontalAlign="Center" Font-Bold="False" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="系統標識">
<ItemTemplate>
<%# Eval("Function_IsSys").ToString() == "1" ? "系統定義" : "用戶自定義"%>
</ItemTemplate>
<HeaderStyle Font-Bold="False" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField HeaderText="功能描述" DataField="Function_Description">
<HeaderStyle HorizontalAlign="Center" Font-Bold="False" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="操 作">
<ItemTemplate>
<%-- <input type="checkbox" id="ckvalue" <%#Eval("Function_IsSys").ToString() == "2"? " " :"disabled='disabled'" %> name="ckvalue" value='<%# Eval("Function_ID") %>' /></ItemTemplate>--%>
<asp:HyperLink ID="Update" ToolTip="修改" runat="server" NavigateUrl='<%#String.Format("ModulFunctionEdit.aspx?id={0}", Eval("FUNCTION_ID")) %>'><img src="../skins/sky/icon/edt.gif" border="0" />修改 </asp:HyperLink>
<asp:HyperLink ID="View" Enabled="false" ToolTip="詳情" runat="server" NavigateUrl='<%#String.Format("ModulFunctionView.aspx?id={0}",Eval("FUNCTION_ID")) %>' ><img src="../skins/sky/icon/layout_content.gif" border="0" />詳細 </asp:HyperLink>
<%#Eval("Function_IsSys").ToString() == "2"?
"<asp:HyperLink ID='Delete' Enabled='false' runat='server' ToolTip='刪除' NavigateUrl='#' ><span style='cursor:pointer' onclick=DelInfoById(" + Eval("FUNCTION_ID") + ",XC_Web.Frame.SystemManage.ModulFunction,'/Frame/SystemManage/ModulFunction.aspx')><img src='../skins/sky/icon/del.gif' border='0'/>刪除</span></span></asp:HyperLink>" :
"<asp:HyperLink ID='Delete' runat='server' NavigateUrl='#' ToolTip='刪除' disabled='disabled' ><img src='../skins/sky/icon/del.gif' border='0'/>刪除</asp:HyperLink>"
%>
</ItemTemplate>
<HeaderStyle Font-Bold="False" />
<ItemStyle HorizontalAlign="Center" Width="22%" />
</asp:TemplateField>
</Columns>
