Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

Updatable Marquee

by the3factory 3/13/2008 10:58:00 PM
 

By Using AJAX Timer and Update Panel we can develop Updatable News Marquee, Latest rows will add automatically to Marquee, like this sample used in Stock Marquee which view last symbols (live).

UpdatePanel and Timer place inside marquee tag < >.

Background

In the past we can't catch every new row from data source and view it on the marquee without postback.

Using the code

Collapse
public string MarqNews, strTitle;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
NewsTable();
}
}
protected void btnAdd_Click(object sender, EventArgs e)
{
strTitle = txtTitle.Text.Trim();
ViewState["Title"] = strTitle;
}
public DataTable NewsTable()
{
DataTable dt_News = new DataTable();
dt_News.Columns.Add("ID", typeof(int));
dt_News.Columns.Add("Title", typeof(string));
dt_News.Rows.Add(1, "CNN");
dt_News.Rows.Add(2, "BBC");
dt_News.Rows.Add(3, "America Radio");
dt_News.Rows.Add(4, "Euro News");
dt_News.Rows.Add(5, "India News");
if (txtTitle.Text != "")
{
dt_News.Rows.Add(dt_News.Rows.Count + 1, (string)ViewState["Title"]);
}
Cache["UpdatedNews"] = dt_News;
return (DataTable)Cache["UpdatedNews"];
}

License

Tags:

Asp.net | HTML

Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0