i believe that <script runat="server"> is the same as writing <%, but apparently you aren't supposed to mix them because the code blocks might not run in the expected order.
Yes I believe as long as you use VBScript server-side and JavaScript client-side (i.e. the defaults) you probably won't even have to use that.
And it's easy to use the value of a VBScript variable in JavaScript:
document.writeln('<%= MyVBScriptVariable %>');
It's also easy to use the value of a VBScript function in javascript:
document.writeln('<%= MyVBScriptFunction() %>');
Or here is an example which puts the value of a VBScript variable into a JavaScript alert box:
Response.Write "<script language='JavaScript'>alert('The value is " & MyVBScriptVariable & "');</script>"
i believe runat describes a control that is run on the server side ...aka if you want a drop down list that requires the database to query what the items in that list are, then you need to use runat...else the control doesnt have to connect to the server to find out...i think when u use runat, it establishes a connection...which in turn uses bandwidth. If it was done without runat=server...then it would be built into the control and the database would not need to be accessed...
i think the question here is...do we need to store everything in the database (which could slow down the database in some cases) or do we only store info that gets updated regularily in the database (and use the runat=server for those)....
im still new to this...i may be wrong..lol. =] or i may have misunderstood the question..lol.
Bookmarks