473,396 Members | 2,011 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.

runat server?

(In my transition from ASP to ASP.NET)

*When* would I use at "runat server" tag on a button, as opposed to a normal
button?

If I set up a search area on a page, with a 'Search' button that applies the
entered items to the db - is that best as a normal button or server
control.... and why?

Steve
Nov 18 '05 #1
4 1879
There is an awful lot that can be said about this but in a nutshell:

Server Controls provide the developer with an easy and rich way of applying
server-side compiled code to the control. Normal HTML controls (without the
runat=server) can only be programmed client-side.

Server Controls render themselves as pure HTML and possibly JavaScript, so
they are browser safe, but can provide very rich functionality (validation
controls, calendar, datagrid, etc.).

Server Controls maintain their own state between page calls, HTML controls
do not.

In short, use Server Controls when you want to be able to program events for
the control on the server and/or have the control maintain its own state.

Use standard HTML controls when you don't need/want this functionality and
don't want the overhead associated with them.

Use HTML Server controls (standard HTML controls with runat=server added to
them) when you are taking an existing classic HTML/ASP application and want
to upgrade it to ASP.NET without having to create all new controls on the
page.
"Steve Bywaters" <by******@bigpond.net.au> wrote in message
news:el*************@TK2MSFTNGP11.phx.gbl...
(In my transition from ASP to ASP.NET)

*When* would I use at "runat server" tag on a button, as opposed to a normal button?

If I set up a search area on a page, with a 'Search' button that applies the entered items to the db - is that best as a normal button or server
control.... and why?

Steve

Nov 18 '05 #2
Thank you for that!
So let's see if I've got it....<g>

To submit a bunch of parameters for a database search, I need some kind of
button.. but which?:

* I don't want to use an asp:button, because I don't need the extra
functionality
* I could add a normal HTML button and add "run at=server"... but why?
* I might as well just use a conventional HTML button, to submit the form
with the search parameters - yes?

Steve
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:O7**************@TK2MSFTNGP12.phx.gbl...
There is an awful lot that can be said about this but in a nutshell:

Server Controls provide the developer with an easy and rich way of applying server-side compiled code to the control. Normal HTML controls (without the runat=server) can only be programmed client-side.

Server Controls render themselves as pure HTML and possibly JavaScript, so
they are browser safe, but can provide very rich functionality (validation
controls, calendar, datagrid, etc.).

Server Controls maintain their own state between page calls, HTML controls
do not.

In short, use Server Controls when you want to be able to program events for the control on the server and/or have the control maintain its own state.

Use standard HTML controls when you don't need/want this functionality and
don't want the overhead associated with them.

Use HTML Server controls (standard HTML controls with runat=server added to them) when you are taking an existing classic HTML/ASP application and want to upgrade it to ASP.NET without having to create all new controls on the
page.
"Steve Bywaters" <by******@bigpond.net.au> wrote in message
news:el*************@TK2MSFTNGP11.phx.gbl...
(In my transition from ASP to ASP.NET)

*When* would I use at "runat server" tag on a button, as opposed to a

normal
button?

If I set up a search area on a page, with a 'Search' button that applies

the
entered items to the db - is that best as a normal button or server
control.... and why?

Steve


Nov 18 '05 #3
> To submit a bunch of parameters for a database search, I need some kind of
button.. but which?:

* I don't want to use an asp:button, because I don't need the extra functionality

Ok, then don't use this one.
* I could add a normal HTML button and add "run at=server"... but why?
I only suggest this when you are taking an existing Classic HTML or ASP
page and are upgrading it to .NET and you need to have the benefits of a
server control. If you don't need those benefits, then you don't need this
either.
* I might as well just use a conventional HTML button, to submit the form with the search parameters - yes?

Sounds good to me!

The basic rule is simple, use standard HTML controls if they will do the
job. If you need server-side programmability or you need the control to
maintain its own state or you need a control that the standard HTML controls
don't offer (calendar, validation control, etc.) then go for the Server
Controls.


Steve
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:O7**************@TK2MSFTNGP12.phx.gbl...
There is an awful lot that can be said about this but in a nutshell:

Server Controls provide the developer with an easy and rich way of

applying
server-side compiled code to the control. Normal HTML controls (without

the
runat=server) can only be programmed client-side.

Server Controls render themselves as pure HTML and possibly JavaScript, so they are browser safe, but can provide very rich functionality (validation controls, calendar, datagrid, etc.).

Server Controls maintain their own state between page calls, HTML controls do not.

In short, use Server Controls when you want to be able to program events

for
the control on the server and/or have the control maintain its own state.
Use standard HTML controls when you don't need/want this functionality and don't want the overhead associated with them.

Use HTML Server controls (standard HTML controls with runat=server added

to
them) when you are taking an existing classic HTML/ASP application and

want
to upgrade it to ASP.NET without having to create all new controls on the page.
"Steve Bywaters" <by******@bigpond.net.au> wrote in message
news:el*************@TK2MSFTNGP11.phx.gbl...
(In my transition from ASP to ASP.NET)

*When* would I use at "runat server" tag on a button, as opposed to a

normal
button?

If I set up a search area on a page, with a 'Search' button that
applies the
entered items to the db - is that best as a normal button or server
control.... and why?

Steve



Nov 18 '05 #4
Again - thank you very much, Scott.

Steve
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...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
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...
9
by: Jay | last post by:
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
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>
3
by: ADavidson | last post by:
I'm getting a {"Parser Error: The Runat attribute must have the value Server." } error when I try to get the Server.GetlastError() in the Global.asax codebehind. Why am I getting this? I...
3
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
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...
11
by: gunjan.mait | last post by:
hi, i wanted to know the exact use of runat="server" which is being used is ASP.NET why we every time need to use it, even when i want to do the work at client side? How to do simple processings...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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
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.