473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why is the runat='server' not default?

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 control.

Why is this the case? shouldn't the runat='server' be default?

regards,
Abhishek.
Nov 18 '05 #1
4 2259
I assume you are talking about cases where you are in HTML view and typing
in the tags yourself because if you were using the design mode and "drawing"
the controls, runat=server is automatically placed in the code for you.

When you are in HTML mode, you will get intelliSense help with closing tags
and attribute lists but it's not going to assume anything about the values
of those attributes. I agree that it would be nice (since I can't imaging
having a server control that doesn't runat the server!), but the HTML view
is just not setup that way.
"Abhishek Srivastava" <ab*****************@nospam.net> wrote in message
news:OF****************@TK2MSFTNGP10.phx.gbl...
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 control.

Why is this the case? shouldn't the runat='server' be default?

regards,
Abhishek.

Nov 18 '05 #2
Scott,

You are right. However, there should be a base class for all server
controls which should assume the value of this attribute as server (if
nothing else is specified). So that programmers or IDEs don't have to
repeatedly specify this.

For notepad programmers it is convienient. and for IDEs it is less code
bloat.

regards,
Abhishek.

Scott M. wrote:
I assume you are talking about cases where you are in HTML view and typing
in the tags yourself because if you were using the design mode and "drawing"
the controls, runat=server is automatically placed in the code for you.

When you are in HTML mode, you will get intelliSense help with closing tags
and attribute lists but it's not going to assume anything about the values
of those attributes. I agree that it would be nice (since I can't imaging
having a server control that doesn't runat the server!), but the HTML view
is just not setup that way.
"Abhishek Srivastava" <ab*****************@nospam.net> wrote in message
news:OF****************@TK2MSFTNGP10.phx.gbl...
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 control.

Why is this the case? shouldn't the runat='server' be default?

regards,
Abhishek.


Nov 18 '05 #3
I agree 100%. It's just that the HTML editor in VS.NET isn't much more than
a glorified FrontPage editor (in fact, in some ways FrontPage is better).
"Abhishek Srivastava" <ab*****************@nospam.net> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Scott,

You are right. However, there should be a base class for all server
controls which should assume the value of this attribute as server (if
nothing else is specified). So that programmers or IDEs don't have to
repeatedly specify this.

For notepad programmers it is convienient. and for IDEs it is less code
bloat.

regards,
Abhishek.

Scott M. wrote:
I assume you are talking about cases where you are in HTML view and typing in the tags yourself because if you were using the design mode and "drawing" the controls, runat=server is automatically placed in the code for you.

When you are in HTML mode, you will get intelliSense help with closing tags and attribute lists but it's not going to assume anything about the values of those attributes. I agree that it would be nice (since I can't imaging having a server control that doesn't runat the server!), but the HTML view is just not setup that way.
"Abhishek Srivastava" <ab*****************@nospam.net> wrote in message
news:OF****************@TK2MSFTNGP10.phx.gbl...
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 control.

Why is this the case? shouldn't the runat='server' be default?

regards,
Abhishek.


Nov 18 '05 #4
use the design view to create all your controls, then use code view to move
them around and do all the 'real' work

R

"Abhishek Srivastava" <ab*****************@nospam.net> wrote in message
news:OF****************@TK2MSFTNGP10.phx.gbl...
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 control.

Why is this the case? shouldn't the runat='server' be default?

regards,
Abhishek.

Nov 18 '05 #5

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

Similar topics

1
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
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...
3
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>
7
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim...
2
by: Sen Mathew via .NET 247 | last post by:
Dear all I also have problem with Datagrid Complaining'DataGridLinkButton' must be placed inside a form tag withrunat=server. But My file is an ascx file ie it is a usercontrol. I call this file...
4
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
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
by: robert | last post by:
Just wondered what the difference is between a div with runat=server vs panel. I use these two tags when I want to show/hide a section of the page. I know Microsoft push for developers to use the...
4
by: Erland | last post by:
Hello everyone, I am have couple of bad concepts and would like to clear things up. As I understand ASP.NET server controls contain runat=server tag and they only run on the server. But I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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,...

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.