C# for webpages

HSN

Newcomer
Joined
May 2, 2004
Messages
23
Hello,

How would I use C# programs as scipts in webpages? Like using ASP or PHP or JavaScript. What should my web hosting server support in order to use C#?

Please give me examples on using a C# program in a webpage.

THX
 
As long as the host supports asp.net applications, it doesn't matter what the scripting language is. You can include the C# in the page in many different ways. You can use <script> tags with an optional runat=server attribute if you want to use any functions or objects declared in the code-behind file. You can use the <% %> syntax to include the code alongside html code. And of course you can just use the code behind file. Also you can use the <%# %> syntax to bind data straight into html code. It replaces whatever value you put <%# databound %> with whatever the result of the expression is...very convenient.
 
Ok thanks. So, if I'm running my web sites on a linux/unix webserver, I can't have C# scripts in my pages... right?
 
As far as I know you'll need IIS 6? (MS web server, dont know about version nr though) to run ASP.NET pages.

Maybe mono (http://www.mono-project.com/about/index.html) has something to run ASP.NET in Linux, but I dont know much about that project. Only that they are working on getting .NET running on linux. Dont know if they'll also support ASP.NET.
 
That seems to be really useful. It says that they have developed a compiler for C# on linux! What I was looking for it is there then. ASP.NET libraries are also included as they mentioned.
 
Back
Top