ASP.NET - how to use marquee tag in asp.net

Asked By rajkumar sendhilnathan on 30-Nov-10 05:15 AM
hi......


i want to include marquee tag in my asp.net website project

pls give me a example for tht
Manoranjan Sahoo replied to rajkumar sendhilnathan on 30-Nov-10 05:20 AM
add one label into your page if you want to put the value from server side and do the code like below in code behind :
Label1.Text="<marquree bgcolor=orange width=100 height=20>Hello World</marquee>";

otherwise you can directly put inside your page inside the <body></body> tag
Reena Jain replied to rajkumar sendhilnathan on 30-Nov-10 05:21 AM
hi,

The marquee tag is a non-standard http://en.wikipedia.org/wiki/HTML element which causes text to scroll up, down, left or right automatically.
here is the eg
<marquee direction=up onmouseover="this.stop()" onmouseout="this.start()" scrollamount="-3" id="Marquee1" runat="server">
the marquee element has several http://en.wikipedia.org/wiki/HTML#Attributes that can be used to control and adjust the appearance of the marquee.
Align
Uses the same syntax as the http://en.wikipedia.org/wiki/HTML_element#Images element.
Behavior
Allows the user to set the behavior of the marquee to one of three different types:
  • Scroll (default) – Scrolls the text from right-to-left, and restarts at the right side of the marquee when it has reached the left side. Text disappears when looping finishes.
  • Slide – When used in absence of the 'Behavior' attribute, contents to be scrolled will slide the entire length of marquee but stops the moment it hits the end, so that the contents will be displayed. But if it is used with attribute 'Behavior' then the attribute 'Slide' will be ignored.

Loops are counted by each time it reaches each end of the marquee; a loop of 1 is different from 'Slide' attribute. when item is being scrolled with 'Slide' attribute, item will stop permanently at the end of length of the marquee, displaying the entire item. However, when an item is being scrolled without a 'Loop' attribute, the number of scrolls will be repeated according to what number 'Loop' is equal to. If 'Loop=1' then item will scroll only once and will exit the length of marquee completely, while the item being scrolled will stop would be the same as 'Slide'. By default, 'Loop=infinite' so it is not needed to code the attribute 'Loop' is you want a non-stop scroll. Note: 'Loop' will be ignored if attribute 'Behavior' is coded. Also, if 'Behavior=Alternate' and 'Loop=2' then item will go from beginning of the Marquee to the end and back to the beginning, counting a round trip as 2 loops.

Bgcolor
Sets the background color of the marquee.
Direction
Sets the direction of the marquee box to either left-to-right, right-to-left, up-to-down and down-to-up.
Width
This sets how wide the marquee should be.
Loop
This sets how many times the marquee should 'Loop' its text. Each trip counts as one loop.
Scrollamount
This is how many pixels the text moves between 'frames'. So scrollamount=1 gives you the slowest scroll speed.
Scrolldelay
This sets the amount of time, in milliseconds, between 'frames'. Much like watching a replay of a video where every frame of the video would be paused for x number of miliseconds. So, 'Scrolldelay=1000' means a slow motion where every frame lasts one thousand miliseconds or one second.
hope this will help you
Prabhanjan Bharti replied to rajkumar sendhilnathan on 30-Nov-10 05:21 AM
You can just add

on aspx page

<tr>
<td>
<marquee  behavior="scroll" direction="left" >HELLO THIS IS MY WEBSITE</marquee>
</td>
</tr>
rohan patel replied to rajkumar sendhilnathan on 30-Nov-10 05:37 AM
Go to this link

http://www.mountaindragon.com/html/marquee.htm

and put that code on your design page

Rohan Patel
http://patelrohan.blogspot.com/
rajkumar sendhilnathan replied to Manoranjan Sahoo on 30-Nov-10 05:55 AM
thanks g its working

how to change fore color and font style
rajkumar sendhilnathan replied to rohan patel on 30-Nov-10 06:01 AM
thankyou g


its nicely working
harry dark lord replied to rajkumar sendhilnathan on 30-Nov-10 06:11 AM
add this in ur .aspx page

<marquee behavior="alternate" direction="left">PANTRY MANAGEMENT SYSTEM</marquee>

u can also use behaviour like

<marquee behavior="left" direction="left">PANTRY MANAGEMENT SYSTEM</marquee>

or

<marquee behavior="right" direction="left">PANTRY MANAGEMENT SYSTEM</marquee>

or

<marquee behavior="scroll" direction="left">PANTRY MANAGEMENT SYSTEM</marquee>

u can also use TOP and BOTTOM in behaviour..........
Manoranjan Sahoo replied to rajkumar sendhilnathan on 30-Nov-10 06:24 AM
you can make one css class for this and apply that css style to the label1 as follows :

<head>
<style>
.marqueestyle
{
  font-size:11px;
  font-family:Arial;
}
</style>
</head>
<asp:Label id="Label1" CssClass="marqueestyle" runat="server" />

Sudhansu shekhar replied to rajkumar sendhilnathan on 23-Apr-12 04:45 AM

hi

 <marquee behavior="scroll" direction="up" scrollamount="2" onmouseover="this.setAttribute('scrollamount', 0, 0);"
              onmouseout="this.setAttribute('scrollamount', 2, 0);">
            
  your text or any control here
           </marquee>

try to this one.........
Manoj Kadyan replied to Manoranjan Sahoo on 17-Jul-12 08:54 AM
Hi

will you help me guys to know, do marquee have any property to set font family and fore-color or any other way to use these two options for marque instead of css.