日期:2014-05-17 浏览次数:20439 次
<asp:DataList ID="DataList2" runat="server" RepeatColumns="4" OnItemCommand="DataList1_ItemCommand">
<ItemTemplate>
<asp:LinkButton ID="lkbImg" runat="server">
<img src='/Student/UpSmallPhoto/<%# Eval("Photo_Path")%>' style="border-width:0px" width="133px" height="100px"/>
</asp:LinkButton>
<asp:LinkButton ID="pass" CommandName="workPass" style="text-decoration:none;color:#ff0000;" runat="server" Text="审核通过" CommandArgument =<%# Eval("Work_ID")%>/>
</div>
</ItemTemplate>
</asp:DataList>
//PageLoad下:
SqlConnection mycon = mydata.sqlcon;
mycon.Open();
string sqlstr = "select * from Stu_Work order by Work_PostDate DESC";
SqlDataAdapter MyAdapter = new SqlDataAdapter(sqlstr, mycon);
DataSet ds = new DataSet();
MyAdapter.Fill(ds, "Stu_Work");
DataRowView rowview = ds.Tables["Stu_Work"].DefaultView[0];
string is_Pass = rowview["Pass"].ToString();
if (is_Pass == "1")
{
this.pass.Enabled = false;
}