In source code(aspx):-
<marquee direction="left" onmouseout="this.start()" onmouseover="this.stop()"
scrolldelay="10"
style="height: 11px">
<asp:Literal ID="lt1" runat="server"></asp:Literal></marquee>
In .cs code:-
SqlConnection SqlCon = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConNews"].ConnectionString);
protected void Page_Load(object sender, EventArgs
e)
{
SqlDataAdapter da = new
SqlDataAdapter("select
* from newsmarquee", SqlCon);
DataSet ds = new DataSet();
da.Fill(ds, "newsmarquee");
string s1;
for (int num = 0; num
< ds.Tables[0].Rows.Count-1; num++)
{
string
url = "~/Images/meta3.gif";//dr[num]["ItemPath"].ToString();
Image newpic = new
Image();
newpic.ImageUrl = url;
////lt1.Controls.Add(newpic);
s1 = ds.Tables["newsmarquee"].Rows[num][1].ToString();
lt1.Text = s1.ToString();
}
}
No comments:
Post a Comment