62,025
社区成员
发帖
与我相关
我的任务
分享
<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1" DefaultMode="Edit"
DataKeyNames="AssetID" Width="100%" OnItemUpdated="FormView1_ItemUpdated" OnItemInserted="FormView1_ItemInserted"
OnDataBound="FormView1_DataBound">
<InsertItemTemplate>
<table class="tableadd">
<tr>
<th colspan="2">
新增资产
</th>
</tr>
<tr>
<td class="tdbg1">
领用人
</td>
<td class="tdbg2">
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="AssetCollect"
ErrorMessage="不能空"></asp:RequiredFieldValidator>--%>
<asp:CheckBoxList ID="AssetCollect" runat="server" CellPadding="2"
DataSourceID="chechBoxListObjectDataSource" DataTextField="UserName"
DataValueField="Admin_ID" RepeatDirection="Horizontal">
</asp:CheckBoxList>
</td>
</tr>
<tr>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
//FX_ClassTableAdapter
{
ViewState["admin_passprot"] = Request.RawUrl;
if (!AdminBLL.CheckBoolAdminPower(25)) //检测权限
{
this.FormView1.Enabled = false;
}
string m_Action = Request.QueryString["Action"]; //判断链接地址加载(FormView1)页面模板
if (m_Action == "Add")
{
FormView1.DefaultMode = FormViewMode.Insert;
}
if (m_Action == "Show")
{
FormView1.DefaultMode = FormViewMode.ReadOnly;
//listBanding();
CheckBoxList _AssetCollect = (CheckBoxList)FormView1.FindControl("AssetCollect");
_AssetCollect.Enabled = false;
CheckBoxList _AssetTransact = (CheckBoxList)FormView1.FindControl("AssetTransact");
_AssetTransact.Enabled = false;
}
}
}
<ItemTemplate>
<table class="tableadd">
<tr>
<th colspan="2">
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="Admin_Class.aspx"> 查看所有资产</asp:HyperLink>
</th>
</tr>
<tr>
<td class="tdbg1">
领用人
</td>
<td class="tdbg2">
<asp:CheckBoxList ID="AssetCollect" runat="server" CellPadding="2"
DataSourceID="chechBoxListObjectDataSource" DataTextField="UserName"
DataValueField="Admin_ID" RepeatDirection="Horizontal">
</asp:CheckBoxList>
</td>
</tr>