One more easy question about asp.net

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!
Does this really make sense because I seen it many times in different kind
of books. It says
<head runat="server" >
<title>SomeTitleHere</title>
</head>

I mean this runat=server for a title element does not make sense to me. It
would have made sense if this runat=server would have been on a asp:Button
element.

//Tony
 
Does this really make sense because I seen it many times in different kind
of books. It says
<head runat="server" >
<title>SomeTitleHere</title>
</head>

I mean this runat=server for a title element does not make sense to me. It
would have made sense if this runat=server would have been on a asp:Button
element.

No sense at all from that example.
 
Does this really make sense because I seen it many times in different kind
of books. It says
<head runat="server">
<title>SomeTitleHere</title>
</head>

I mean this runat=server for a title element does not make sense to me. It
would have made sense if this runat=server would have been on a asp:Button
element.

Correct.

I would be very skeptical about that book.

Arne
 
Arne Vajhøj said:
Correct.

I would be very skeptical about that book.

Arne

Yes I agree but the use of runat=server in the head element is used in many
books.

//Tony
 
Yes I agree but the use of runat=server in the head element is used in many
books.

When they put that attribute on head becomes a HtmlContainerControl and
can be manipulated from code behind.

The only point I can see is if they build a single example
from simple to complex and need to change the head from code
behind later.

If there is no such usage later, then I would consider it very bad
practice to always add the attribute.

Arne
 
Tony said:
Hello!
Does this really make sense because I seen it many times in different kind
of books. It says
<head runat="server">
<title>SomeTitleHere</title>
</head>

I mean this runat=server for a title element does not make sense to me. It
would have made sense if this runat=server would have been on a asp:Button
element.

You already asked that question on 29/11/2010 in the aspnet group. Don't
you remember the answers you were given?
 
Jason Keats said:
You already asked that question on 29/11/2010 in the aspnet group. Don't
you remember the answers you were given?

The answer that was given then was not fully correct that why I asked it
again.

//Tony
 
Hello!
Does this really make sense because I seen it many times in different kind
of books. It says
<head runat="server" >
   <title>SomeTitleHere</title>
</head>

I mean this runat=server for a title element does not make sense to me.It
would have made sense if this runat=server would have been on a asp:Button
element.

//Tony

You'll going to need the "runat=server" in the head element if your
pages wanted to support "Themes".
 
Back
Top