Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When writing code, i got some troubles. It's:

1. I defined this for C# web code:
<%@ Page Language="C#" %>
Can you tell me how to the browser compile the C# code?
I mean: Can Firefox throw exceptions?

2. When loading, the pages which wrote by C#, will be loaded faster or slower than javascript and CSS?

3. Will I need hosting which is supported for C# to run the code?

Thank for help!
Posted
Updated 27-Aug-14 6:48am
v2
Comments
Richard C Bishop 27-Aug-14 12:43pm    
Your fundamental understanding is flawed. A browser does not compile anything, it simply renders what the server returns. C# is a server language and is not comparable to CSS or javascript. CSS is strictly for styling and javascript is a client side scripting language. Browsers don't throw exceptions, they render what the server returns.
Sergey Alexandrovich Kryukov 27-Aug-14 12:58pm    
Agree. I would add that the HTTP server delegates compilation to the compiler installed on the system; it can be actually MSBuilt. ASP.NET functionality is based on .NET Framework installed on the system, and the network comes with C# (and VB.NET) compilers which always present. CodeDOM can be used. This is the implementation detail of some server's plug-in.
—SA

1 solution

1. Browsers do not compile code. IIS and ASP.Net do and then send html to the browser.
2. C# loads on the server and JavaScript and CSS are applied by the browser on the client computer.
3. Yes, you need to have a hoster who supports ASP.Net.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Aug-14 13:00pm    
The compilation is done by a compiler provided with .NET Framework installation. (Voted 4.)
—SA
Valery Possoz 27-Aug-14 15:14pm    
I might be wrong but I though ASP.net was compiling the sites using Aspnet_compiler.exe, not the compilers provided by the framework (or at least not directly)
ZurdoDev 27-Aug-14 15:15pm    
Yes, it is ASP.Net which is then managed via IIS.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900