Solved

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

Posted on 2015-02-06
12
103 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
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
Comment Utility
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 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
Comment Utility
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
a space missing after new keyword:

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

Author Comment

by:vrosas_03
Comment Utility
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 74

Accepted Solution

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

Author Closing Comment

by:vrosas_03
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now