Yuming Cao
Yuming Cao

Reputation: 955

Why I have both javascript code in .aspx file and c# codes in .cs file?

I'm currently working on an ASP.Net web application. Just curious when I noticed that I have both javascript codes and C# codes. Is it possible to transfer all my javascript codes to c# codes to make it looks more consistent? Thanks!

Upvotes: 0

Views: 136

Answers (3)

Icarus
Icarus

Reputation: 63966

Javascript is a language that executes on the Browser, on the Client Side; C# code is executed on the web server.

Upvotes: 0

n8wrl
n8wrl

Reputation: 19765

C# is your server-side, back-end logic to support your web page. The JavaScript is client-side code running in the browser, often to improve the user experience and perform some logic or UI operations wihtout having to go to the server.

Upvotes: 0

Justin Niessner
Justin Niessner

Reputation: 245429

No. JavaScript code executes on the Client Side. C# executes on the Server Side. They perform two different functions and can't be treated interchangeably.

Upvotes: 3

Related Questions