Server and Client Scripting for a newbie

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I am quite new when it comes to web development with ASP.net.

I understand about the aspx file and the behind code (.vb). However I
thought that asp is developed using asp code <% %> and client script. In the
asp.net structure i have an aspx file that i add a button to. When i double
click this button in vs.net it opens the behind code file and i can edit the
button click function. Is this server side code? where is the server and
client code? Or is it different in asp.net as opposed to ASP.

Also just in general, how do i know when to use client code and when to use
server side code?

Thanks,

Joshua Weir
 
Hi,

ASP.NET support various models of writing Server-Side code. One of the best
ways is to utilize the Code-Behind files. SO when you double click on a
button and write code in the *.vb file that code will always execute on the
Server-Side.

Also you can still use server-side scripts within the <% %> in ASP.NET but
its not recomended.

The third way is to write server side script within the script tage inside
the aspx file itself eg.

<html>
<head>
<script language="VB" runat="server">
' your functions here
</script>
....

The runat="server" attribute in the script tag instructs ASP.NET to execute
the code on the server side.

Now to write client-side code, you need to use JavaScript/VBScript using the
normal script tags like you must have been using in ASP.
 
Back
Top