Introduction
-
Simple Marquee with text.
-
Simple Marquee with controls in it.
-
Dynamic Marquee Populated from database values.
Background
To make our ASP.Net web page very design effective we need to display some animation on the page. One of the animations can be done using a marquee in ASP.Net. We can scroll the text within a specified area for that maximum developers use the login like using Ajax update panel, timer, and in this case every time we need the partial postback to the server. But the use of a marquee will not do any partial post back to the server and in a very simple manner, we can show the scrolling text or images using a marquee. So let's see how to display a marquee from the basic level to advanced level one-by-one.
Simple Marquee with Text
To display marquee HTML provide the <marquee></marquee> tag in which we can show any simple text or controls like hyperlinks, images, etc. See the following piece of code used to show only a simple marquee with text. One more thing about a marquee is that they move in a given area, which means the controls (parent) they move.
- <marquee><strong> Simple Marquee Text</strong></marquee>
- <div style="width: 927px; background-color: #FFFF00;">
- <marquee direction="left"><strong> Simple Marquee Text(Left Direction)</strong></marquee>
- </div>
- <div style="width: 927px; background-color: #CCFFCC;">
- <marquee direction="right"><strong> Simple Marquee Text(Right Direction)</strong></marquee>
- </div>
Simple Marquee with Controls
I think so up to now you understand how to show simple marquee with text. So let's move to show the marquee containing an ASP.Net control in it. See the following lines which contain hyperlink control and Image Control.
- <div style="background-color: #FFCCFF">
- <marquee direction="Up"><strong> <a href="#">Simple Marquee With Hyperlink In Up Direction</a></strong></marquee>
- </div>
- <div style="background-color: #CCCCFF">
- <marquee direction="down"><strong>
- <asp:Image ID="img" runat="server" ImageUrl="~/wait.gif" /></strong></marquee>
- </div>
In the previous two marquees, we showed one hyperlink control with an up direction and one image control with a downward direction.
Up to here, we have seen a basic marquee with text and user controls. Now we will see some advanced marquees which populated from a database and when we take our mouse pointer over them they will stop and we move out of it, then again it will start working.
Dynamic Marquee with Database
In so many cases we need to show some news for our application provided by the site administrator. The news can be dynamic every time new news occurs. That kind of news can be shown on a marquee. In the first example, we will see the marquee which will move in the up direction, and the second one will move in the down direction. For providing mouseover stop and start we have an attribute like:
onmouseover="this.stop()"
onmouseout="this.start()"
In the above line "this" refers to the marquee on which we have given the attribute. See the full code below to populate the marquee from database and display it on the page.

kaynat anjumPosted Jul 22, 2017, 3:47 AM
Href=somepage.aspx is same for all the content can be change for particular content.
RJ RajPosted Jul 13, 2017, 6:44 AM
Great work Sir, thank you
siva raguPosted Jun 12, 2017, 3:22 AM
Thank you sir Great
Prakash TPosted Apr 26, 2017, 4:47 AM
Really Super thanks a Lot sir.
kalu singh raoPosted Jul 8, 2016, 1:22 AM
Nice...
Dhanik SahniPosted Dec 30, 2015, 4:30 AM
very nice
Rana SunnyPosted Jun 25, 2015, 9:20 AM
nice work
sapna yelapurePosted Apr 20, 2015, 12:05 AM
Element 'marquee' is not supported ,please tell why this is so...
Dinesh GurjarPosted May 31, 2014, 2:25 AM
Best article...
Khan Abrar AhmedPosted May 28, 2014, 7:54 AM
I used this in my web application thank you very much for providing the artical.
Akanksha SinghPosted Mar 15, 2013, 2:18 AM
useful article....thanx a lot.. :)
Krishna GaradPosted Aug 16, 2012, 5:59 AM
thanks snehal
SnehalPosted Jul 15, 2012, 2:59 AM
very useful article...... thanx a lot
Sonakshi SinghPosted Jan 9, 2012, 11:15 PM
I want to know more about this topic... hope you will present something more related to it very soon.. anyways this is really a good one
Amit MaheshwariPosted Jan 9, 2012, 1:30 PM
That's a nice effort to accomplish such task thanks for sharing.......
Akash AhlawatPosted Jan 9, 2012, 12:01 PM
Nice topic
Arjun PanwarPosted Jan 9, 2012, 11:06 AM
Really nice Explaination
Vineet Kumar SainiPosted Jan 8, 2012, 11:35 PM
Good article...
Monika AroraPosted Jan 8, 2012, 11:15 PM
Nice concept. I will surely try this.