public partial class kaoshi : System.Web.UI.Page
{
public int int_row1 = 0;
public int int_row1Point = 0;
public int hsgzf = 0;
protected void Page_Load(object sender, EventArgs e)
{
//string dd1 = Application["d1"].ToString();
//string dd2 = Application["d2"].ToString();
if (Session["username"] != null)
{ }
else
{
Response.Write("<script>javascript:alert('對不起,請您先登陸!');history.back();</script>");
Response.End();
}
if (!IsPostBack)
{
Button2.Visible = false;
string sql;
sql = "select top 5 * from shiti where 1=1 order by newid() desc";
DataSet result = new DataSet();
result = new Class1().hsggetdata(sql);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
DataList1.DataSource = result.Tables[0];
DataList1.DataBind();
}
else
{
DataList1.DataSource = null;
DataList1.DataBind();
}
}
for (int tID1 = 1; tID1 <= DataList1.Items.Count; tID1++)
{
Label lblSelect = (Label)DataList1.Items[tID1 - 1].FindControl("Label2");
lblSelect.Text = tID1.ToString() + "、";
Label lblSelect2 = (Label)DataList1.Items[tID1 - 1].FindControl("Label1");
lblSelect2.Visible = false;
}
}
}
uj5u.com熱心網友回復:
求教大神解釋最好詳細點。菜鳥看不懂。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/80103.html
標籤:網絡及通訊開發
上一篇:OPENCV打開攝像頭出問題
下一篇:Matlab 呼叫 C++ 元件
