Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old January 26th, 2014, 05:51 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Antonius Block (January 26th, 2014)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.