Solved

Do you need to install C# separately on ASP.NET

Posted on 2015-02-06
12
111 Views
Last Modified: 2015-02-14
This must be too basic a question and I have to assume that you have a choice of using C# or VB.NET in ASP.NET pages because there is nothing online about it.  Also I'm wondering if there is a separate pure ASP.NET language that is not VB.NET
0
Comment
Question by:vrosas_03
  • 5
  • 4
  • 3
12 Comments
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40595013
When you install Visual Studio, it comes with all sort of language options like vb.net, c#, F#, c++.

And then on top of that, that you have the choice of developing windows applications or asp.net. applications.

Have you installed Visual Studio? If not, there is Express version you can download and work with it from http://www.visualstudio.com/en-US/products/visual-studio-express-vs.

Mike
0
 

Author Comment

by:vrosas_03
ID: 40595021
Ok so your saying that ASP.NET requires visual studio?  You can't use notepad to create ASP.NET files?
0
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40595025
No. You can do using notepad. It will be much harder without all those intellisense and other tools.

There was a company I did a project that they installed the backbone .net famework but had to proceed without visual studio. Not very many people choose that option maybe that is why you are not able to find many references to it.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40595073
ASP.NET is a server-side framework for creating web applications. It sits atop the .NET Framework. You certainly could write your pages using Notepad, but it would be difficult, as was already mentioned. And theoretically you could write the "code-behind" pages in any .NET language (e.g. C++.NET), but at this time it's really only C# and VB.NET which have integrated support within Visual Studio. You only need code-behind pages for dynamically generated content. If you're just serving up static content, then you would work with IIS directly rather than needing anything that ASP.NET provides.
0
 

Author Comment

by:vrosas_03
ID: 40595080
I don't want to actually use notepad.   I was just using notepad an example.   I use vim.  Is there a compile involved?   Or can IIS display C# text files?
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 40595083
IIS is a web server (software), so yes, it can display text files. You can host media files, XML files, HTML files, etc.

There's only a compile involved if you make either an ASP.NET web site project (and precompile it), or if you make an ASP.NET web application project. If you just host static files, like HTML, then you don't have anything to compile.
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 40595089
P.S.

Even if you did need to compile, the C# and VB.NET compilers are invoked from the command line. You could easily write a batch file or even an MSBuild file to automate your compilation. But again, you only need this if you're using ASP.NET for dynamic content. I've never really compiled anything by command line directly, but I have seen it demonstrated in the docs. I'm not certain how web site projects compile, but I'm sure it's documented somewhere.
0
 

Author Comment

by:vrosas_03
ID: 40595091
It seems like it can handle plain text files.  I only need to run a few lines of asp.net code:

It works with this code:

			<p><% Response.Write(Now())%></p>

Open in new window

   But I got an error on the following code:
			<%
	string[] myArr = newstring[] { "a","b","c","d","e"};

foreach (string strArr in myArr)
{
     Response.Write(strArr + " ");
}

				%>

Open in new window


The second section of code doesn't work but the first does.  I get this error:
C:\inetpub\wwwroot\iisstart.aspx(40) : error BC30109: 'String' is a class type and cannot be used as an expression.

    string[] myArr = newstring[] { "a","b","c","d","e"};

Open in new window

0
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40595100
a space missing after new keyword:

string[] myArr = new string[] { "a","b","c","d","e"};
0
 

Author Comment

by:vrosas_03
ID: 40595107
I noticed that and changed it and it still doesn't work.  

 BC30109: 'String' is a class type and cannot be used as an expression.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 40596942
That code should work fine. Are you sure those are the offending lines?
0
 

Author Closing Comment

by:vrosas_03
ID: 40610376
I was able to run the text files with c# in them if  they are surrounded by the <%   %>  tag delimiters.  I don't know if it pre-compiles it beforehand  but there is a compiler in the IIS folders  and I can compile c# code using the compiler in those folders.      Apparently it works the same as php with a few minor changes.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FInd Image Control Gridview 3 23
ASP.NET Content Page 3 35
PHP 5.6 and 7.x 4 23
Where does legacy ASP.NET initialize language? 2 27
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question