一个页面,左面是人员图片,比如:1号、2号、3号,人员图片滚动
右边是题目列表,题目要滚动点击开始时 人和题目都是随机抽取结束抽取时一人对应一个题目这种情况怎么设计?用什么控件?用定时器滚动行吗?

解决方案 »

  1.   

    js+ajax就可以,只要人员和题目适当对应
      

  2.   

    using System;
    using System.Configuration;
    using System.Data;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Data.SqlClient;
    using System.Security.Cryptography;
    using System.Text;public partial class _Default : System.Web.UI.Page
    {
        protected string randCode;
        protected int ms;
      
        protected void Page_Load(object sender, EventArgs e)
        {        ////if (!IsPostBack)
            ////{
            Timer2.Enabled = false;
            DateTime dt = DateTime.Now;
            randCode = MD5(dt.ToString("yyyy:MM:dd HH:mm:ss")).Substring(0, 20);//"test";        Timer2.Enabled = true;
            ////}    }    public static string MD5(string number)
        {
            ASCIIEncoding ASCIIenc = new ASCIIEncoding();
            string strReturn = "";
            byte[] ByteSourceText = ASCIIenc.GetBytes(number);
            MD5CryptoServiceProvider Md5Hash = new MD5CryptoServiceProvider();
            byte[] ByteHash = Md5Hash.ComputeHash(ByteSourceText);
            foreach (byte b in ByteHash)
            {
                strReturn += b.ToString("x2");
            }
            return strReturn;
        }
        protected void Timer2_Tick(object sender, EventArgs e)
        {
            if (Session["KG"].ToString().Equals("K"))
              {
                string yzm = "";
                yzm = randCode;
                yzm = yzm + "dsf";
                this.Label3.Text = yzm;
            }
            else
            { }
        }
          protected void Button1_Click(object sender, EventArgs e)
        {
            Timer2.Enabled = true;
            Session["KG"] = "K";//开始
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            Timer2.Enabled = false;
            Session["KG"] = "G";//结束
          }
      }
    为什么上面的代码控制计时器时反应不灵敏呢?比如点击开始按钮,有时得点击好几下计时器才开始,点击结束好几下计时器才关闭,甚至关闭不了
      

  3.   

    html:<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                   <%-- <asp:Timer ID="Timer3" runat="server" Interval="1000" Enabled="False"     ontick="Timer3_Tick" >
                    </asp:Timer>--%>
                    <asp:Timer ID="Timer2" runat="server" Enabled="true" Interval="10"      ontick="Timer2_Tick">
                    </asp:Timer>
                    <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label><br />
                    <asp:Button ID="Button1" runat="server" Text="开始" onclick="Button1_Click"  />
                    <asp:Button ID="Button2" runat="server" Text="结束" onclick="Button2_Click" />
                    
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        </form>
    </body>
    </html>