Can someone help me convert my .cs file to aspx.cs

I thought I could just put my same cs code into this file that would open a webpage but apparently things are different. I need this because I have a login file that has three options for the user, the page I am building takes in their username, authorization and database information and then outputs all of that into a text file. The problem is I have to link the .cs file to the asp.net file and it is really complicated (for me).

I am new to coding so any help or suggestions would be greatly appreciated. Also if you have any tutorials or websites that could assist me that would be great!

If you need to see my code let me know!

Ae you using visual studio to build the pages? This should have been taken care of automatically. Your .aspx page needs a directive at the top pointing to the code behind file to use:

<%@ Page language="C#" codebehind="your .cs file" inherits="" %>

Ae you using visual studio to build the pages? This should have been taken care of automatically. Your .aspx page needs a directive at the top pointing to the code behind file to use:

<%@ Page language="C#" codebehind="your .cs file" inherits="" %>

Yes I am using visual studio. I built the page with c# with a .cs file. I made a login page in asp.net and I need the page to come up when the option of the .cs file comes up. Right now it is just giving me an error so I know I need to somehow link it to the login page.

Would it be easier to just make it an aspx.cs file or keep it mine and add some sort of code to make it link and come up as a webpage?

just make it an .aspx page. Be easier in the end.

just make it an .aspx page. Be easier in the end.

I agree with you. I have been working on this for a few days now.

Do you you have recommendations for tutorials on coding in aspx.cs? I can code in .cs but its not the same type in aspx.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.