Solved

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

Posted on 2015-02-06
12
107 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 33

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 33

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 33

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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