Server and Client Scripting for a newbie

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top