日期:2014-05-16 浏览次数:20458 次
<asp:TemplateField HeaderText="黑白名单">
<EditItemTemplate>
<asp:TextBox ID="BlackAndWhite" runat="server" TextMode="MultiLine" Wrap="true" Text='<%#Bind("BlackAndWhite")%>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:TextBox ID="BlackAndWhite" runat="server" TextMode="MultiLine" Wrap="true" Text='<%#Bind("BlackAndWhite")%>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
protected void modifyButton_Click(object sender, EventArgs e)
{
using (VOTEDATAEntities myEntities = new VOTEDATAEntities())
{
Task aTask = myEntities.Tasks.SingleOrDefault(tt => tt.TaskName == taskName);
aTask.BlackAndWhite = ((TextBox)DetailsView1.FindControl("BlackAndWhite")).Text;
int result = myEntities.SaveChanges();
}
}