8
Is it possible to create a site only with HTML and C#, without ASP.NET? In general, as?
8
Is it possible to create a site only with HTML and C#, without ASP.NET? In general, as?
8
Yes, HTML is default. CSS is also almost mandatory in practice. JS will probably be used. All this on the client side.
On the server side you can use virtually any language. C# is one of them, and one of the most viable. It is one of the 3 most widely used languages throughout the web.
You don’t need to use classic ASP.NET, but you probably want to use some other ASP.NET technology close to this. You can use technologies other than ASP.NET, you can take these technologies that are open source and modify to suit your needs. An example is Nancy quoted by Omni.
If you want you can reinvent the wheel, but even I like it to have more control probably wouldn’t do it.
Detailing how to do it is very broad, but the two main ways is to use the web server API, probably IIS or Apache, sending messages to it from what you want to provide and receive messages from it from requests or use CGI, then it’s basically write to the console and set up for the server to capture it. Each server can have its own way of communicating with the server application.
You need to find a good reason to do this. If it’s performance I think you have other better ways to achieve the goal. If you don’t have to learn a technology, it probably doesn’t make up for the effort you’ll have to make on hand.
Note that it is possible to avoid Webforms which is obsolete and considered bad by many, or even avoid MVC which is a little heavy, improved on ASP.NET Core, but is still a cannon to kill bird in many cases. There are problems that don’t need models and controllers. And it’s true that in the simplest cases, the last thing you want to do is communicate with the HTTP server at hand. For this there is the Razor Pages.
It is good to remember that ASP.NET Core has own HTTP server, which can be used in many situations, but not at all. And now counts up to proxy reverse.
Have questions on the website with more details.
Good explanation. If we stop to think, since ASP.NET itself was developed in C#, nothing would stop us from creating a concurrent library for web application development, but as mentioned, it would reinvent the wheel, correct?
@Alisson correct. It can even tamper with existing code since it is totally free, free in the sense of free even, not in the sense of GPL that is not free of truth.
Browser other questions tagged c# html asp.net
You are not signed in. Login or sign up in order to post.
Is that just curiosity or is there some other motivation? Suddenly you intend to create a C# site without ASP.NET to be able to host on Linux servers instead of Windows.... if that were the case, then we could mention other solutions...I was just curious with your question.
– Alisson
@Alisson was just curious!
– isaque
@Take a look at the Nancyfx. And a way to build the site without using, or relying on ASP.NET (MVC).
– Omni
@Omni blz, I’m gonna look
– isaque