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.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" <abhishek-srivastava@.nospam.net> wrote in message
news:OFw%234V57DHA.2044@.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.
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" <abhishek-srivastava@.nospam.net> wrote in message
> news:OFw%234V57DHA.2044@.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.
>
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" <abhishek-srivastava@.nospam.net> wrote in message
news:OOdlVK77DHA.2952@.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" <abhishek-srivastava@.nospam.net> wrote in message
> > news:OFw%234V57DHA.2044@.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.
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" <abhishek-srivastava@.nospam.net> wrote in message
news:OFw%234V57DHA.2044@.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.
Saturday, March 31, 2012
Why is the runat=server not default?
Labels:
application,
asp,
attribute,
controls,
default,
developing,
erver,
net,
realized,
runatserver,
server,
therunat
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment