开发者

HTML and c# how to bind label value to marque

How to pass the values which i have in label.text to the marque .can any one give me a开发者_如何学C idea..


You may achieve this in this fashion

Assign the label text to a literal in this way

  literal.Text = string.Format("<marquee>{0} </marquee>", lbl.Text);

OR

Show it in the label

lbl.Text = string.Format("<marquee>{0} </marquee>", "Hello Scrolling text");


In you page create a public property

public string MarqueText { get; set; }

Populate the property in Page_Load

protected void Page_Load(object sender, EventArgs e)
{
    MarqueText = "The text to display in marque, very long long text e.t.c";
}

Then use the property in your aspx page by asp.net code block.

<marquee scrollamount="3"><%= MarqueText %></marquee>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜