logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
techie
#1 Posted : Monday, May 03, 2010 12:50:13 AM(UTC)
Quote
techie
Rank: Member

Reputation:

Joined: 3/5/2010(UTC)
Posts: 24

How I can create a marquee tag in ASP.Net that gets data from a database …
(Marquee: it is a moving text and is normally used as an HTML tag).

My requirement is to show the marquee as an hyperlink whihc shows up the current month as text.
Sponsor

Soan
#2 Posted : Monday, May 03, 2010 2:51:05 AM(UTC)
Quote
Soan
Rank: Administration

Reputation:

Joined: 1/9/2010(UTC)
Posts: 449
Man
Location: India

Was thanked: 1 time(s) in 1 post(s)
You can use the following method.

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

Then you can give value for the literal in code behind (C#).

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

Hope it helps.
Guest
#3 Posted : Saturday, April 07, 2012 9:43:23 AM(UTC)
Quote
Guest
Rank: Guest

Joined: 12/12/2009(UTC)
Posts: 540

soan ur method is good but wat if i have to choose the direction of marquee as up?
Tejashri
#4 Posted : Wednesday, April 18, 2012 7:02:59 AM(UTC)
Quote
Guest
Rank: Guest

Joined: 12/12/2009(UTC)
Posts: 540

but how should we increase the space for that moving marquee
Guest
#5 Posted : Wednesday, April 18, 2012 7:08:08 AM(UTC)
Quote
Guest
Rank: Guest

Joined: 12/12/2009(UTC)
Posts: 540

string str = "Tejashri";
string text = "<Marquee direction='Up'>" + str + "</Marquee>";
Literal1.Text = text;
Guest
#6 Posted : Monday, May 07, 2012 3:56:00 AM(UTC)
Quote
Guest
Rank: Guest

Joined: 12/12/2009(UTC)
Posts: 540

Sir, I need multiple text which are displayed one after another. So, should I need another string or what else?

Thanks and regards
Ranjit Dutta.
Soan
#7 Posted : Monday, May 07, 2012 11:33:39 AM(UTC)
Quote
Soan
Rank: Administration

Reputation:

Joined: 1/9/2010(UTC)
Posts: 449
Man
Location: India

Was thanked: 1 time(s) in 1 post(s)
Yes Ranjit, you can try multiple strings to get the effect for multiple string.
Or if all the strings are pointing to same hyperlink, you can include it in single marquee tag.
Guest
#8 Posted : Saturday, June 09, 2012 10:15:38 AM(UTC)
Quote
Guest
Rank: Guest

Joined: 12/12/2009(UTC)
Posts: 540

sir how to data fetch from database in string format ? in same question
Soan
#9 Posted : Sunday, June 10, 2012 12:52:31 AM(UTC)
Quote
Soan
Rank: Administration

Reputation:

Joined: 1/9/2010(UTC)
Posts: 449
Man
Location: India

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Guest Go to Quoted Post
sir how to data fetch from database in string format ? in same question


You need to use any DB control like SQLdatasource and then place your DB table query. Once the query runs and returns the string, you can pretty well use it in the Marquee tag.

Share you code and then i can help you with exact code.
Guest
#10 Posted : Tuesday, July 17, 2012 2:24:25 AM(UTC)
Quote
Guest
Rank: Guest

Joined: 12/12/2009(UTC)
Posts: 540

Hi,

i need to change the marque text when clicking next & previous button is it possible?


Regards,

Vinothini. D
Soan
#11 Posted : Wednesday, July 18, 2012 11:16:58 AM(UTC)
Quote
Soan
Rank: Administration

Reputation:

Joined: 1/9/2010(UTC)
Posts: 449
Man
Location: India

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Guest Go to Quoted Post
Hi,

i need to change the marque text when clicking next & previous button is it possible?


Regards,

Vinothini. D


Yes, It is possible.
Just change the value of variable 'str' in above code on the click of your previous and next buttons. It should work.

Let me know if you need more information.
Quick Reply Show Quick Reply
Users browsing this topic
Guest (3)
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.