C
C#2mo ago
emperor.2707

Establishing binding between css and c# and sql

Hello, I made a login page with CSS, but I don't know how to connect it with C# and SQL. Can anyone help me with this?
22 Replies
Jimmacle
Jimmacle2mo ago
you need a backend that serves your page and handles the form submission to do whatever you want to do in the database $helloaspnet
MODiX
MODiX2mo ago
Get started with ASP.NET Core
A short tutorial using the .NET CLI to create and run a basic Hello World app using ASP.NET Core.
emperor.2707
emperor.2707OP2mo ago
I know I will do this with C# but I don't know how to put the connection. And frankly I don't understand much from these articles.
Jimmacle
Jimmacle2mo ago
you will make an ASP.NET Core project of some kind and build your page there whether that's MVC, Razor pages, Blazor, etc you don't usually connect a plain html/css page as-is
✿ Scarlet ✿
✿ Scarlet ✿2mo ago
You need an Api interface
Jimmacle
Jimmacle2mo ago
i mean, that's an option but won't work properly if all they have is a single static page we need $details
MODiX
MODiX2mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
emperor.2707
emperor.2707OP2mo ago
So, do I need to build the website I want to create via C#? As far as I understand, what I write with CSS will just stay that way.
Jimmacle
Jimmacle2mo ago
you can't write a page with just css you have html too, and usually some javascript for interactivity but you don't want it to stay that way, right? you want someone to be able to type in a username and password, submit, and be redirected based on whether they put in vaild credentials or not
emperor.2707
emperor.2707OP2mo ago
of course
Jimmacle
Jimmacle2mo ago
so you need a backend that can do that and send new pages/set cookies based on their input
Jimmacle
Jimmacle2mo ago
Introduction to Razor Pages in ASP.NET Core
Explains how Razor Pages in ASP.NET Core makes coding page-focused scenarios easier and more productive than using MVC.
emperor.2707
emperor.2707OP2mo ago
Jimmacle
Jimmacle2mo ago
fyi, i don't respond to DMs from this server
emperor.2707
emperor.2707OP2mo ago
Okey So, is there a chance to transfer the login page I wrote in vs code to c#?
Jimmacle
Jimmacle2mo ago
yes, look through that guide and you'll see that the .cshtml files are similar to plain html files
emperor.2707
emperor.2707OP2mo ago
Thank you very much I am new to these topics. Thanks for your help I didn't think making a website would be this complicated
Jimmacle
Jimmacle2mo ago
technically what you have now is a website, but making websites interactive with logic is more complicated yeah
emperor.2707
emperor.2707OP2mo ago
How long does it take to make an interactive website on average?
Jimmacle
Jimmacle2mo ago
impossible to tell it depends on your skill level and the complexity of the site
emperor.2707
emperor.2707OP2mo ago
It is actually a simple site, user login, after logging in, the rules and information are fixed things.
Want results from more Discord servers?
Add your server