asp.net中的动态选框

时间:2011-03-22 04:52:58

标签: asp.net

如何在c#.net中创建动态选取框?这意味着我想在主页中显示公告,在分配的空间中从上到下显示方向,一次只显示两个公告网,它应该是动态的。谢谢。

2 个答案:

答案 0 :(得分:1)

<asp:Literal ID="Literal1" runat="server"></asp:Literal>

Then you can give value for the literal.

protected void Page_Load(object sender, EventArgs e)
{
    string str = "get data from database";
    string text = "<MARQUEE>" + str + "</MARQUEE>";
    Literal1.Text = text;
}

http://www.htmlcodetutorial.com/_MARQUEE.html

http://logicbox.net/jquery/simplyscroll/horizontal.html

答案 1 :(得分:0)

可以使用jquery插件轻松完成...尝试使用http://www.gmarwaha.com/jquery/jcarousellite/我觉得它几乎可以自定义。

问候。

<div>
        <button class="prev">
            <<</button>
        <button class="next">
            >></button>
        <div class="anyClass" >
            <ul >
                <li style="padding:0px 10px">
                    <a href="#">This is a test Text to test this scroll 1</a></li>
                <li style="padding:0px 10px">
                    This is a test Text to test this scroll 2</li>
                <li style="padding:0px 10px">
                    This is a test Text to test this scroll 3</li>
                <li style="padding:0px 10px">
                    This is a test Text to test this scroll 4</li>
            </ul>
        </div>
    </div>

<script language="javascript">
        $(function () {
            $(".anyClass").jCarouselLite({
                btnNext: ".next",
                btnPrev: ".prev",
                auto: 1000,
                speed: 1000,
                visible: 1
            });
        });
    </script>