Hi
What are the differences between Server-side and Client-side code in ASP.NET ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Parthiban SelvarajPosted Jun 25, 2012, 6:36 AM
code is always process by server whereas client side code is executed by client
side script or to be precise client side browser.
If we want to access server side database or files we will have to use server
side code and if we want to handle client side validation we will have to use
client side code.
The common script used for client side script is JavaScript. whereas for server
side code the common script is VBScript.
Client side code validate the data before sending it to server. Where as server
side code validate data to check whether sent data is correct or not.
Thanks,
Parthiban
Prathap KumarPosted Jun 25, 2012, 6:29 AM
Server Side Code :
It is written in the .CS file for C# and .vb file for VB.Net
Server side code will always run on server side and create round trip on server in the response of request for any aspx page.
These will consume the servers memory.
server side code validate data to check whether sent data is correct or not.
Client Side Code :
It is a scripting language (JavaScriptpt or vb script) that can be included in the HTML Page or can contain in the Source File either .vb or .cs .
It runs on client's browser it does not create any round trip to the server.
e.g validation of controls dynamically hiding and displaying some of controls or there values etc.
The reason why we do client side validations is to save the to and from time taken for the request to go to the server and the response to get back to the browser.
Client side code validate the data before sending it to server.
Regrads
Prathap