Forums » .NET » .NET »

Explain the differences between Server-side and Client-side code?


Posted Date: 25 Aug 2008      Posted By:: sahasra     Member Level: Silver    Member Rank: 1984     Points: 1   Responses: 8



Explain the differences between Server-side and Client-side code?



Responses

#286670    Author: Bindu Bujji      Member Level: Gold      Member Rank: 0     Date: 25/Aug/2008   Rating: 2 out of 52 out of 5     Points: 6

Hi,
Server Side Code
Server side is the code that resides at web server.
For every client request code is executed at server side and result is send to the client in simple HTML format.
Performance is lower than client side code due to server round trips.
Client cannot see the business logic though it is stored on server.

Client Side Code
Client side code is reside at client's browser itself. It is executed at client side only. User can easily see the code by View - > Source option.
It is generally used in validation form like text field is empty or not, email address validation etc. It is faster than server side code.

server side code is responsible to execute and provide the executed code to the browser at the client side. the executed code may be either in XML or Plain HTML. the executed code only have the values or the results that are executed on the server. The clients browser executes the HTML code and displays the result.

where as the client side code executes at client side and displays the result in its browser. it the client side core consist of certain functions that are to be executed on server then it places request to the server and the server responses as the result in form of HTML.



Hope this helps
Bindu


 
#286703    Author: kalaimanichozhan      Member Level: Gold      Member Rank: 450     Date: 26/Aug/2008   Rating: 2 out of 52 out of 5     Points: 2

Servide side codes are execute in the Server(IIS).
Client side code are execute in the Browser(IE,FireFox,etc..)

With Regards
Kalai


 
#286793    Author: Ultimaterengan      Member Level: Gold      Member Rank: 10     Date: 26/Aug/2008   Rating: 2 out of 52 out of 5     Points: 3

hi,
http://www.allinterview.com/showanswers/4627.html
http://www.exforsys.com/forum/microsoft-net/95736-what-differences-between-server.html
http://www.geekinterview.com/question_details/1407

i hope this may help u



Thanks & Regards
G.Renganathan
Nothing is mine ,Everything is yours!!!






 
#286822    Author: RobinHood      Member Level: Gold      Member Rank: 45     Date: 26/Aug/2008   Rating: 2 out of 52 out of 5     Points: 4

Difference..
Client-Side Code..
1.Client side validation done at browser.
2.Object created by browser is called client side control.
3.Mandatatory fields checking are done in client side.

Server-Side Code..
1.Server side validation done on server side controls.
2.Object created by server is called Server side control.
3.Login userid and password checking are done in server side.

Regards
Sridhar R
Nothing is illegal, Until You Get Caught


 
#286833    Author: Vijayaragavan.R      Member Level: Bronze      Member Rank: 0     Date: 26/Aug/2008   Rating: 2 out of 52 out of 5     Points: 6

Understanding the difference between "Client Side" and "Server Side"

We get so many inane questions that revolve around this subject that I decided to try and be more helpful by providing a sort of "reference" document that will enable people who may be confused to read up a bit and save everybody some time. In fact, its more of a selfish move on our part, since now if I can get most of the information into this document, then the next time somebody asks another one of these questions, all we have to do is point them to this article.

First, the simple explanation:

Client side is what's happening on your computer in your browser. It has nothing to do with the server, or ASP or ASPX pages, or IIS, or the database, or ANYTHING ELSE. JavaScript in a web page would be an example of something client side. You don't need the server to help with the functionality of the script. If you can run it on your computer (without a server being installed) and it works, it's client side. In fact, when a web page is sitting in your browser after it has been processed by the server and sent "over the wire", there is absolutely no further connection with the server whatsoever at this point. NONE! ZERO! NADA, ZIP! The page in your browser has absolutely NO KNOWLEDGE of the server or what may be going on there, and conversely, the web server machine that served the page to your browser hasn't got the slightest idea of who you are or where you are, or whether you ever even visited the web site at all! The Web is Stateless, my son -- just like your mind on a Spring Saturday afternoon! May all your methods return, etc. etc.

Server side is when the server is being used to process something. Script or code that is run on the server does NOT appear on or in the web page that is sent to your browser -- the web page that your browser receives is only the RESULT of the script or database code or processing that happened on the server.

With these two beliefs firmly fixed in our minds like concrete sticking to the sides of the Grand Coulee Dam, let's take it down to the next level and get into a few more details. Client side code is usually (but not always) Javascript. Forget about writing to the user's hard drive, or saving a file somewhere, or writing to the user's Registry with client - side script. It ain't gonna happen. Browser vendors have tightened up security restrictions to the point where unless you are exploiting some security hole that hasn't been patched, you may as well forget about these types of things. Forget about downloading files and depositing them on the user's hard drive and having them run. No way, DUDE!

Now let's say you have a textbox in a web page and you want to use client side code to make something happen. For example, every time somebody types another letter in a text field, you want to go out and search your database and come back and fill a listbox with the closest matches. Can you do this with client side code?

Client side code triggering Server Side processing

Well, yes and no. Remember the page doesn't have any further connection with the server that sent it to the browser. However the client side code CAN cause, for example, a form on the page to activate its submit method, and if the ACTION atttribute of the form points to a page that will receive the form posts and generate the return data, it can be done. However too many people continue to make the fallacious assumption that some client - side event, such as selecting a listbox item, or the onblur event of leaving the focus from one control is going to enable them to get server - side code or events to run. What it MAY do is create a post or "postback" event. This really means we have made a NEW TRIP to the webserver with some specific information that the SERVER SIDE code is prepared to react to, and it will regenerate the page and send it back to the browser. With Smartnavigation and other features, it may appear the page has not really been reloaded, but 99% of the time, it has.

The only exception to the above is when we use COM components from the CLIENT, such as XMLHTTP, to issue their own GET or POST action to a receiving web page on the SERVER, which sends back new information. The component receives this without a page reload, and using DHTML, we can update client-side DOM items in the page. Another technique is to use hidden IFRAMES to perform similar actions "behind the scenes" and receive data. However, the data must be requested from the same domain the page was requested from, or security restrictions will prevent our access to the data in the IFRAME. Newer implementations of "Remote Scripting", which was invented by Microsoft about 1998 are using the term "AJAX". This is just a buzzword for remote scripting or "Script Callbacks" which are now built into ASP.NET 2.0.


 
#286841    Author: D.Jeya kumar(JK)      Member Level: Gold      Member Rank: 13     Date: 26/Aug/2008   Rating: 2 out of 52 out of 5     Points: 6

Hi,

Server side code will be executed in server side and the client side code will be executed in Client side ie in client browser.

Server side code is a compiled code it is compiled by vb.net or c# compiler where as the client code are not it should be supported by browser.

When we validate the controls in serverside it will take time to get the response and post the pages.

client side code will be validated by the browser itself so it will not take time. without post back client side code will validate.

Client side code will be usually added between
<Head></Head>
and the server side code will be added in code behind in .aspx.vb or .aspx.cs file.

Regards
JK

Thanks & Regards
D.Jeya Kumar(JK)


 
#287616    Author: Balthazor      Member Level: Gold      Member Rank: 243     Date: 27/Aug/2008   Rating: 2 out of 52 out of 5     Points: 6

Hi there,
Have you ever had a look at this before?
Just check all this links below for more,

www.tutorials007.com/index.php/difference-between-server-side-and-client-side/

www.geekinterview.com/question_details/1407

www.exforsys.com/forum/microsoft-net/95736-what-differences-between-server.html

www.developer.com/tech/article.php/923111

www.c-sharpcorner.com/Interviews/Answer/Answers.aspx?QuestionId=1&MajorCategoryId=1&MinorCategoryId=1

kyapoocha.com/aspnet-interview-questions/explain-the-differences-between-server-side-and-client-side-code/

www.coolinterview.com/interview/2075/

www.eggheadcafe.com/PrintSearchContent.asp?LINKID=569


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Name any 2 of the 4 .NET authentication methods?
Previous : Calculate weeks in a month
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John

Online Members

fabricio
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India