Server Side or Client Side


Hi I'm a bit confused about this whole server side / client side thing. Are applets, embeded objects consider client side? If I have a form within my aspx page which connects to a database on the server side what is it considered? If I have some business logic written within a VB file when the client access the functions within that business logic (for example some kind of validation function) does the client browser actually downloads that VB file? Can someone suggest how to differentiate between client side and server side components within a asp.net based website? 
0
rjjctm
5/28/2007 4:36:05 AM
📁 asp.net.getting-started
📃 91979 articles.
⭐ 2 followers.

💬 4 Replies
👁️‍🗨️ 706 Views



Hi,
i can't understand your actual problem but i m just trying to solve your confusion bet. client side and server side.
Suppose u want to apply some business logic and for that u need some data from database side so 4 that u write your all calculation and your all business logic on databaase side to use some "stored procedure" or "triggers" it will give you fast access.
and Suppose u want to apply some business logic and for that u dont need some data from database side so 4 that u write your all calculation and your all business logic on "javascripts" so its totally on "client side scripting". and page doesnt need to go back on server.

Thanks & regards,
Dhaval Shah

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
0
dhaval_lion
5/28/2007 5:01:35 AM

Hi rjjctm,
If you go to http://www.webopedia.com type server-side
"Occurring on the server side of a client-server system. For example, on the World Wide Web, CGI scripts are server-side applications because they run on the Web server. In contrast, JavaScript scripts are client-side because they are executed by your browser (the client). Java applets can be either server-side or client-side depending on which computer (the server or the client) executes them. "

In your case:

If I have a form within my aspx page which connects to a database on the server side what is it considered?

( SERVER-SIDE )

If I have some business logic written within a VB file when the client access the functions within that business logic (for example some kind of validation function) does the client browser actually downloads that VB file

( SERVER-SIDE )

-------------------------------------

Simple Scenario:

You have an object called [ACCOUNT]:

ACCOUNT have 2 property, ACC_NO and ACC_LIMIT.

Given rules ACC_NO is unique and ACC_LIMIT cannot be greater than 5000.

 *** To validate above ( remember, always client-side get executed first ):

1) We validate ACC_LIMIT using client-side ( javascript )

<script language="javascript">

function ValidateAccountLimit(value)

if ( value > 500)

{

alert("Account limit cannot be greater than 5000");

return false;

}

</script>

2) Validate ACC_NO using server-side (c#)

private bool IsAccountNoExisted(string sAccNo)
{

DataSet ds = SqlHelper.ExecuteDataSet(&quot;Select * from Account where ACC_NO=&#39;&quot; + sAccNo + &quot;&#39;&quot;);

if ( ds != null )
    if ( ds.table[0].Rows.count &gt; 0 )
        return true; // return true where record found
return false; // return false record not existed
}

 

Hope this is clear enough.

 

 

 

 


            
DC517
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
0
d4dennis
5/28/2007 5:09:07 AM

SERVER SIDE VS CLIENT SIDE
Simply put there are two distinct operations involved in displaying any web page to the visitor the first being server side operations and the second client side operations.
Server Side Operations
Server side operations are concerned with the sending of the web page data from the server to the web page visitors browser. In the case of Static Web Pages the data is simply served immediately upon request for the data from the visitors browser. If the requested page is a Dynamic Web Page then any pre processing of the page is carried out and the output is then served to the visitor.
PHP and ASP(vbscript) are server side scripting languages that are used to pre process pages and output HTML before the page is sent to the visitor. HTML is the language that the browser understands that tells it how to display the page.
Client Side Operations
Client side operations are performed on the visitors computer by the users Internet browser to display the web page as the data is received from the server.
HTML is interpreted as it is read by the browser resulting in the display of the web page within the browser. Once the page has loaded HTML cannot be reprocessed without refreshing the page.
The visitors experience on the web page can however be enhanced by means of a client side scripting language, typically Javascript used in conjunction with dynamic html and cascading style sheets, which enable interactive menu systems, hi-lighting effects, image effects, data manipulation and many other actions to be performed on the page without reloading or refreshing the page.
The relationship between server side and client side operations can be illustrated by the following example.
Suppose you wanted to display the current time on a web page. You have a number of options, you have the choice of displaying the current time according to the web server or the current time according to the visitors computer.
If you want to use the server time then server side pre processing will be required to determine the current time on the server and write it to the output in html format before the page is sent to the visitor.
To use the visitors local time, the current time on the visitors computer is used to determine the time and display it on the page. Since Javascript is running on the client side the time can be updated and displayed in real time on the page without having to reload or refresh the page.
This is not possible with server side scripting as the page needs to be re processed on the server to determine and output the new time and re send to the visitor in order for the new time to be displayed.
The server time could of course be written to the page as a Javascript variable which Javascript could then use to set a local page time variable which could then be used to keep time. However one must bear in mind that time would elapse between the server creating and writing output for the Javascript time variable and Javascript actually reading in the variable upon page loading. Also one must remember that the updating of the clock would still be performed as a client side Javascript operation.
Whether you choose to display the local time on the server side or client side or any of the standard times such as GMT, PST, EST is irrelevant as both server and client operations use the respective local time and the time zone where the server or client is located to determine the time in the aforementioned standard times.
Although primarily a client side scripting language, Javascript does offer some server side functionality however server side scripting languages such as PHP and ASP are generally far better suited to performing server side operations.
hope this helps./. 

Thanx, 
[KaushaL] || BloG || Profile || Microsoft MVP

"I would love to change the world, but they won’t give me the source code"


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and mark your thread as Resolved for the sake of Future Readers.
0
kaushalparik27
5/28/2007 7:58:02 AM

Thanks all for the help I think I have a better understanding now, Both kaushalparik27 and d4dennis examples helped me realized with some operations you can implemented both on the server side or the client side (ValidateAccountLimit can be done both in a javascript on the client side or a c# or vb based file on the server side but with the later there is the extra hassle of transferring data back and forth). But some operations such as validating account existence have to be done on the server side. I guess you would want as much things executed on client side as possible to reduce load on the server side. 
So I guess to put it simply to determine whether something is server side or clients side code we just have to see where it's executed. Typing the above  sentence out suddenly make it so obvious Big Smile.
0
rjjctm
5/28/2007 9:06:32 AM
Reply: