473,496 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

runat=server mistique

Jay
Where is there a good article/description on why everything is runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat server
in dotnet.

Thank You
Nov 18 '05 #1
9 1509
This attribute just tells ASP.NET to create this control server side when
the page is called, allowing to access this control programmatically.

The control is then rendered client side you may have done programmatically
server side (such as colors or whatever else).

Patrice

--

"Jay" <ja**********@hotmail.com> a écrit dans le message de
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is runat=server. I just can't seem to grasp why ALL tags (even table tags) are runat server
in dotnet.

Thank You


Nov 18 '05 #2
Hey Jay,

My guess is also that they're trying to train us early for some
hopeful/planned day when there is an option where some ASP may be handled
client-side (or some other place not yet dreamed). If not, it seems
redundant to have to explicitly indicate that controls are handled
server-side when they are already by definition are server-side.

- John

"Jay" <ja**********@hotmail.com> wrote in message
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is runat=server. I just can't seem to grasp why ALL tags (even table tags) are runat server
in dotnet.

Thank You

Nov 18 '05 #3
Jay
I understand what you are saying but why? What is the advantage. In
classic asp, I used to generate tags to the client from the server. What is
the difference? I just don't seem to grasp the advantage. The control
ultimately is rendered by the client so what is the difference? See, I'm an
instructor and I need to know the nuts and bolts. Thank You!

"Patrice Scribe" <no****@nowhere.com> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
This attribute just tells ASP.NET to create this control server side when
the page is called, allowing to access this control programmatically.

The control is then rendered client side you may have done programmatically server side (such as colors or whatever else).

Patrice

--

"Jay" <ja**********@hotmail.com> a écrit dans le message de
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is

runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat server in dotnet.

Thank You

Nov 18 '05 #4
This way you have automatically server side objects that are modelling the
"widgets" you'll finally have client side (the basic idea is to create
server side something "similar" to the client side "document" objet).

You can then handle typed controls, get intellisense, type safety,
viewstate, value persistance, design time support and so on. This is nothing
else than a whole infrastructure whose ultimate goal is to create the
underlying HTML (or even whatever else a client such as a mobile phone could
use) in an object oriented manner rather than to spit out directly HTML code
(you can of course till do this with ASP.NET), making creating web forms
similar to creating windows forms.

Don't know the exact reason but at first sight it looks to me quite simple
and consistent to have just to check the runat=server attribute when the
page is loaded.
For plain "HTML" tags you have the choice (depends if you need of rnot to
handle the tag server side).

Patrice

--

"Jay" <ja**********@hotmail.com> a écrit dans le message de
news:bA9Qb.35325$zP6.8531@okepread02...
I understand what you are saying but why? What is the advantage. In
classic asp, I used to generate tags to the client from the server. What is the difference? I just don't seem to grasp the advantage. The control
ultimately is rendered by the client so what is the difference? See, I'm an instructor and I need to know the nuts and bolts. Thank You!

"Patrice Scribe" <no****@nowhere.com> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
This attribute just tells ASP.NET to create this control server side when
the page is called, allowing to access this control programmatically.

The control is then rendered client side you may have done

programmatically
server side (such as colors or whatever else).

Patrice

--

"Jay" <ja**********@hotmail.com> a écrit dans le message de
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is

runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat

server in dotnet.

Thank You



Nov 18 '05 #5
Jay wrote:
Where is there a good article/description on why everything is runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat server
in dotnet.

Thank You


The .aspx file is parsed by ASP.NET on it's first access. The parsing
engine basically creates a C# (or VB.NET) source file that gets compiled
into an assembly based on the contents of the .aspx file.

The code in that assembly basically has calls to Response.Write() for
the parts of the .aspx file that are *not* in a runat="server" tag. It
might not be actual Response.Write() calls, but something with a similar
effect.

The runat="server" tags get parsed into ASP.NET server controls that you
can manipulate in your code-behind.

It boils down to tags that do not have the runat="server" attribute are
sent to the client verbatim. Tags that do have it can be manipulated on
the server before rendering on the client.

--
mikeb
Nov 18 '05 #6
I don't have any good links handy, but will try to explain in a
nutshell.

When you specify the "runat=server" attribute in an HTML tag, it
signifies to ASP.Net that a server side representation of that display
element needs to be created. In your aspx code, you'll have access to
these display elements and change their properties programatically.
There are also convenient data-binding capabilities which can be
applied to these display elements when they're managed by the server.

But not ALL tags need to run at the server. Only those which you wish
to access programatically.

Static html code for building tables that doesn't change shouldn't be
run at server, in fact, by using server controls for static html tags,
you'll only be slowing down the application.

Are you using Visual Studio .Net btw?

"Jay" <ja**********@hotmail.com> wrote in message news:<gY7Qb.35055$zP6.30845@okepread02>...
Where is there a good article/description on why everything is runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat server
in dotnet.

Thank You

Nov 18 '05 #7
Not everything in ASP.Net is runat=server. Only Server Controls are. You can
certainly use plain vanilla HTML in your ASP.Net pages. The biggest
differences between ASP.Net and Classic ASP is the fact that ASP.Net is
object-oriented, and that ASP.Net is much more powerful than Classic ASP.

There are several reasons why object-oriented programming is better than
procedural programming, espcially with regards to web applications. If you
have ever had to maintain some of the old procedural ASP apps, you would
realize that a procedural program, when it reaches a certain size and
complexity, particularly if the developer was not that experienced, is a
bear to maintain. OOP brings organization and encapsulation (as well as the
other features of OOP) to the table.

The extra power is generally what brings the complexity into the picture.
VBScript could do almost nothing on the server. ASP.Net has the full power
of the CLR behind it, and this means that security becomes much more complex
to manage, for one thing. It's a trade-off. More power generally means more
complexity. However, with good OOP Design Practices, the complexity can be
very manageable.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Jay" <ja**********@hotmail.com> wrote in message
news:bA9Qb.35325$zP6.8531@okepread02...
I understand what you are saying but why? What is the advantage. In
classic asp, I used to generate tags to the client from the server. What is the difference? I just don't seem to grasp the advantage. The control
ultimately is rendered by the client so what is the difference? See, I'm an instructor and I need to know the nuts and bolts. Thank You!

"Patrice Scribe" <no****@nowhere.com> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
This attribute just tells ASP.NET to create this control server side when
the page is called, allowing to access this control programmatically.

The control is then rendered client side you may have done

programmatically
server side (such as colors or whatever else).

Patrice

--

"Jay" <ja**********@hotmail.com> a écrit dans le message de
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is

runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat

server in dotnet.

Thank You


Nov 18 '05 #8
Jay
Thank You all so much for all of your replys. What I have learned is that
the concept is much easier that I first thought. But what programming
concept isn't. My synopsis: The only reason to designate a tag to be
runat=server is to be able to have access to it (give it a name) in the
code-behind (period). The advantage that code-behind gives is that the
debugger is available which is was not in classic (period). End of story!

Thank you all once again for your input.

----------------------------------------------------------------------------
----------------------------------
I just want to say, that this netnews concept IS A VERY POWERFUL TOOL. Thank
you for participating...
----------------------------------------------------------------------------
----------------------------------

"Jay" <ja**********@hotmail.com> wrote in message
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is runat=server. I just can't seem to grasp why ALL tags (even table tags) are runat server
in dotnet.

Thank You

Nov 18 '05 #9
Jay
addendum: The debugger and typecasting etc.

"Jay" <ja**********@hotmail.com> wrote in message
news:qJgQb.35565$zP6.18530@okepread02...
Thank You all so much for all of your replys. What I have learned is that
the concept is much easier that I first thought. But what programming
concept isn't. My synopsis: The only reason to designate a tag to be
runat=server is to be able to have access to it (give it a name) in the
code-behind (period). The advantage that code-behind gives is that the
debugger is available which is was not in classic (period). End of story!

Thank you all once again for your input.

-------------------------------------------------------------------------- -- ----------------------------------
I just want to say, that this netnews concept IS A VERY POWERFUL TOOL. Thank you for participating...
-------------------------------------------------------------------------- -- ----------------------------------

"Jay" <ja**********@hotmail.com> wrote in message
news:gY7Qb.35055$zP6.30845@okepread02...
Where is there a good article/description on why everything is

runat=server.
I just can't seem to grasp why ALL tags (even table tags) are runat server in dotnet.

Thank You


Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1638
by: Gary Bagen | last post by:
Hello, I am working on a page transition scheme and was wondering what the quickest way is to find out which ASP.NET controls need to be inside a form with runat=server. I've determined that...
4
9938
by: Matthew Louden | last post by:
It happend to me more than once. When I create web controls or move the positions in VS.NET, I encountered the following run-time errors: It doesn't matter what controls I create, the following...
4
2263
by: Abhishek Srivastava | last post by:
Hello All, While developing an asp.net application, I realized that the runat='server attribute is not default for the asp.net server controls. I have to explicitly put it everytime against each...
3
1848
by: testemail | last post by:
Hello How do I perform a variable replacement in ASP.NET when I am using the runat=server clause to generate a table - it was simple in ASP With ASP : ---------- <HTML> .... <BODY>
3
3759
by: Ferryandi | last post by:
hi, i have created a button link like this and attach it to placeholder in code behind linkbutton1 = New LinkButton linkbutton1.Text = "Link Button linkbutton1.ID = "Link1"...
3
4169
by: Russ | last post by:
I have a usercontrol that is loaded by a webform. The usercontrol populates a datagrid which users need the capability to export data from the grid to Excel. The problem is that when I attempt to...
4
13305
by: Alex Maghen | last post by:
I have a master page which contains a general page framework and also contains a <form runat=server> around most of the content of the page. Inside that <form> tag is a ContentPlaceholder. I...
7
13423
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
3
3517
by: pbd22 | last post by:
Hi. How do I add the runat=server attribute on a buttonfield link dynamically? thanks!
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.