Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm teaching myself, I have learned HTML, CSS, Javascript (still learning) and quite a bit about C#.

My question is can I use the C# that I have learned on the client side? if it's possible, I have made several webpages using ASP.net, I have added a class to a project and I'm stuck.

If it's possible to use C# the way I'm explaining it, how do I link the class page to the project and run it? .

share|improve this question

closed as unclear what you're asking by Ƭᴇcʜιᴇ007, Keltari, Mokubai, Dave, mpy Aug 30 '13 at 13:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

What makes you think you can't use C# for things other than ASP.net web programming? What do you mean by a "Class page"? –  Ƭᴇcʜιᴇ007 Aug 30 '13 at 0:57
Think about it this way, would you like it if a random website could run an arbitrary program that could do whatever it wanted, like for example install a program that recorded every key you press on your computer? There are ways to do it (See Chris O's answer). –  Scott Chamberlain Aug 30 '13 at 3:14
Short answer is no. No one would trust your code, and would leave your site. –  Ярослав Рахматуллин Aug 30 '13 at 6:20
Thanks Scott. To put it straight forward I taught myself c# and I simply want to use c# and not have to to use the Console.WiteLine. –  Dom Sep 1 '13 at 19:59
@user2731196 - What? That makes no sense... How else would you write to the console? Or, are you trying to write a string in a browser? If so, use Response.Write(); –  Dave Sep 2 '13 at 7:24

2 Answers 2

If you're writing a webpage, then your only option for using C# in the client webbrowser is through an ActiveX control. So that mean IE-only browsers and a fair pile of security settings to get right, which affects deployment. If you're doing this only on your machine, then not a problem. C# code could interact with the DOM from the HTML side of things, otherwise it is just code running in the browser, it has nothing to do with the C# code-behind running by the server.

share|improve this answer
Thank you so much for your answer. To be more specific I am rephrase my question. For weeks I am been studying c# and the "Console.WriteLine". I am now using asp.net and creating a website that is not going to be published. On my webpage I am adding a class by selecting add new item. I write my c# code. How can I see my c# code when I press f5 this is what I don't get. I used to write Console.WriteLine what should I do now? Can I create a button and when I click the button see my c# code? Thank you again. –  Dom Sep 1 '13 at 19:52
@user2731196 See System.Diagnostics.Debug.WriteLine. It writes to the Output window within Visual Studio. –  Louis Sep 2 '13 at 0:35
@eiennohito,Thank you this is the qnswer I was looking for. –  Dom Sep 2 '13 at 12:21
Sorry I click enter for a new line and my message got posted. –  Dom Sep 14 '13 at 21:43

If you mean by 'client' the programming for the web browser, then there are some translators to JS from C#. See http://stackoverflow.com/questions/7667327/best-c-sharp-to-javascript-translator.

Creating offline applications using WinForms and WPF is your another option.

share|improve this answer
Hello, I am using visual studio 2012, what is the code to insert a picture from a an image folder in the solution explorer? –  Dom Sep 14 '13 at 21:42
and I just did it again. The folder's name is "image" the picture name is "pic1" here is what I do: <img src="image/pic1.jpg"> and it wont work. Thank you for your help. –  Dom Sep 14 '13 at 21:45
I downloaded visual studio 2013 and I didn't see open "empty razor page" as an option like there was in the 2012 version. Where is it? I try to look for visual studio 2012 to download but it is no where to be found as all the links lead to visual studio 2013. I starting practicing with Databases with visual studio 2012 and I would like to continue. I like to keep using visual studio and not Web Matrix. Thank in advance. –  Dom Nov 15 '13 at 2:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.