What is the difference between a script tag with and without a runat=server attribute

Kutti080808 picture Kutti080808 · Jan 24, 2014 · Viewed 10.4k times · Source

What is the difference between <script runat="server"> and <script> ?

Answer

Zaki picture Zaki · Jan 24, 2014

When you add runat="server" attribute the tag will become available in server side code like any other asp.net control.

Then you will be able to manipulate/add c#/javascript code within the blocks directly.

If you don't add the runat attribute you will be able to only have client side scripting.