Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 26th, 2014, 05:28 PM
Authorized User
Points: 233, Level: 4
Points: 233, Level: 4 Points: 233, Level: 4 Points: 233, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Posts: 44
Thanks: 14
Thanked 0 Times in 0 Posts
Default Page 529 - Removing runat attribute

Hello Imar,

On page 529, (step 9 of a Try It Out) you remove the runat attribute from the <ul> element and not from the <li> element.

I understand that you keep the runat="server" attribute in the <li> element because <li> will be replaced by all the repeated data items from the Pictures EntitySet at the server.

But why removing the runat attribute from <ul> ?

Thank you
 
Old January 26th, 2014, 05:51 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Antonius,

The <ul> is just a plain HTML element and is not accessed by server side code. Therefore, it doesn't need the runat attribute which saves you from some overhead (although it's just a tiny bit).

The <li> needs to run at the server as it's the replacement control for the actual data.

Does that help?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Antonius Block (January 26th, 2014)




Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13, page 454: removal of runat attributes Antonius Block BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 August 24th, 2011 01:33 PM
Removing attribute xsi:nil=true chandra_perni XSLT 10 September 2nd, 2009 12:05 PM
Runat server dilemma ? rsearing ASP.NET 2.0 Basics 1 November 24th, 2006 04:10 AM
<form runat="server"> gopi2008 ASP.NET 1.0 and 1.1 Basics 3 May 21st, 2006 11:07 PM
Runat = Server Lorzendo ASP.NET 1.0 and 1.1 Basics 1 November 12th, 2004 12:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.