0

How can i set my web page title as rotating.
I have a page named "dog.aspx" and its title is "Dog Selection". I want this title to rotate continuously. How can i do this in ASP.net(C#).

3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by __avd
0

What do you mean by "rotate"?
Do you want it to change to some other text in the browser while the user is looking at the page?

0

no sergb. not that way. Let me give u an example.
When we put any text in <marquee></marquee tag it rotates I want rotation in that way.
I tried to put my title in <marquee> tag but it doesnt work.

I hope now u got my question

0

How can i set my web page title as rotating.
I have a page named "dog.aspx" and its title is "Dog Selection". I want this title to rotate continuously. How can i do this in ASP.net(C#).

Timer & document.title property.

<head runat="server">
    <title id="title1">Sample Text &nbsp;&nbsp;&nbsp;&nbsp;</title>
    
    <script type="text/javascript">
        var tid;
        var text = "Sample";
        window.onload = (function() {
            tid = setInterval(rotateText, 100);
        });
        function rotateText() {
           document.title = document.title.substring(1, document.title.length) + "" + document.title.substring(0, 1);
        } 
    </script>
</head>
0

Thanx ADATAPOST.
I got ur reply.
But freind this script will work only for title "Sample" that is static.
I want to make rotation of word which is written in between <title> tag.

0

Thanx ADATAPOST.
I got ur reply.
But freind this script will work only for title "Sample" that is static.
I want to make rotation of word which is written in between <title> tag.

<title><%=publicfield_or_propertyName %></title>
0

Default.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
    string myTitle = "Sample Text";  
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%=myTitle %></title>
     
    <script type="text/javascript">
        var tid;
        var text = "<%=myTitle %>";
        window.onload = (function() {
            tid = setInterval(rotateText, 100);
        });
        function rotateText() {
           document.title = document.title.substring(1, document.title.length) + "" + document.title.substring(0, 1);
        } 
    </script>
</head>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.