hi sir,
I want to scroll data from database like fields are(id,image, description).
what can i do?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijay YadavPosted May 16, 2011, 6:52 AM
on page load event and it is working, take one literal control and assign the marquee like this:
string strData="Hello";
string strMar="";
Literal1.Text=strMar +"
";
And in your case, can you just check by modifying
PlaceHolder2.Controls.Add("<MARQUEE>"+table+"");
Vijay YadavPosted May 16, 2011, 7:21 AM
Suthish NairPosted May 16, 2011, 7:14 AM
Be specific with your thread, so members can provide exact solutions.
Using Jquery you can scroll the text.. Lots of sample available on web.
Vijay,
The HTML <marquee> element is obsolete and should not be used in new HTML documents.
jaheena jamalPosted May 16, 2011, 7:09 AM
I tried that you say. like following
PlaceHolder2.Controls.Add("");
But it has error.
The error is: The best overloaded method match for 'System.Web.UI.ControlCollection.Add(System.Web.UI.Control)' has some invalid arguments.
what is the reason for this error?
jaheena jamalPosted May 16, 2011, 6:36 AM
con.Open();
SqlCommand cmd = new SqlCommand("select top(1) proprtyid,propdistrict,propprice,proplocation from reginfo where confirmation='confirmed' order by dateconfrm desc", con);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
recpid = reader[0].ToString();
recdistr = reader[1].ToString();
recprice = reader[2].ToString();
recloca = reader[3].ToString();
Table table = new Table();
table.Width = 231;
TableRow tr = new TableRow();
TableCell Tc = new TableCell();
Tc.Width = 231;
ImageButton imgbtn = new ImageButton();
imgbtn.ImageUrl = "image1.aspx?pid=" + recpid;
imgbtn.PostBackUrl = "moredetails.aspx?pid=" + recpid;
imgbtn.Width = 200;
imgbtn.Height = 150;
Tc.Controls.Add(imgbtn);
tr.Cells.Add(Tc);
table.Rows.Add(tr);
TableRow tr2 = new TableRow();
TableCell Tc2 = new TableCell();
Tc2.Width = 231;
LinkButton lnkbtn2 = new LinkButton();
lnkbtn2.Text = "District:" + recdistr;
lnkbtn2.CssClass = "dynamiclnkbtn2";
lnkbtn2.PostBackUrl = "moredetails.aspx?pid=" + recpid;
Tc2.Controls.Add(lnkbtn2);
tr2.Cells.Add(Tc2);
table.Rows.Add(tr2);
TableRow tr3 = new TableRow();
TableCell Tc3 = new TableCell();
Tc3.Width = 231;
LinkButton lnkbtn3 = new LinkButton();
lnkbtn3.Text = "Location:" + recloca;
lnkbtn3.CssClass = "dynamiclnkbtn2";
lnkbtn3.PostBackUrl = "moredetails.aspx?pid=" + recpid;
Tc3.Controls.Add(lnkbtn3);
tr3.Cells.Add(Tc3);
table.Rows.Add(tr3);
TableRow tr4 = new TableRow();
TableCell Tc4 = new TableCell();
Tc4.Width = 231;
LinkButton lnkbtn4 = new LinkButton();
lnkbtn4.Text = "Price:" + recprice;
lnkbtn4.CssClass = "dynamiclnkbtn2";
lnkbtn4.PostBackUrl = "moredetails.aspx?pid=" + recpid;
Tc4.Controls.Add(lnkbtn4);
tr4.Cells.Add(Tc4);
table.Rows.Add(tr4);
PlaceHolder2.Controls.Add(table);
Anil KumarPosted May 16, 2011, 6:30 AM
http://www.c-sharpcorner.com/UploadFile/prathore/6651/
Vijay YadavPosted May 16, 2011, 6:27 AM
Anil KumarPosted May 16, 2011, 6:26 AM
http://www.c-sharpcorner.com/UploadFile/munnamax/scrollingNews02252006101507AM/scrollingNews.aspx
jaheena jamalPosted May 16, 2011, 6:20 AM
how can i give dynamic controls into marquee tag
regards
jahi
Vijay YadavPosted May 16, 2011, 6:14 AM
jaheena jamalPosted May 16, 2011, 6:10 AM
how can i do that? How can i place in marquee tag?
Vijay YadavPosted May 16, 2011, 6:01 AM
jaheena jamalPosted May 16, 2011, 5:58 AM
I think you'll not understand what i say. I want to scroll automatically just like marquee.
Regards
Jahi
Vijay YadavPosted May 16, 2011, 5:50 AM
jaheena jamalPosted May 16, 2011, 5:47 AM
Anil KumarPosted May 16, 2011, 5:33 AM
ex.
public void BindData(int ID)
{
SqlConnection myConnection = new SqlConnection("-----put your connectin string -----");
myConnection.Open();
string sql = "SELECT * FROM [myTableName] WHERE [id] = " + ID;
SqlCommand myCommand = new SqlCommand(sql, myConnection);
SqlDataReader myDR = null;
myDR = myCommand.ExecuteReader();
if(myDR.HasRows)
{
txtName.Text = myDR["id"];
// ...and so on
}
}
Abhimanyu K VatsaPosted May 16, 2011, 5:32 AM
jaheena jamalPosted May 16, 2011, 4:29 AM
Vijay YadavPosted May 16, 2011, 3:53 AM
jaheena jamalPosted May 16, 2011, 3:09 AM
Already i took datas from databse. And i want to scroll this datas.
Regards
Jahi
Vijay YadavPosted May 16, 2011, 2:51 AM