Creating simple c# web site - c#

I have created a web site definition in IIS and when I create a new web form in Visual Studio it keeps creating it as a .vb instead of a .cs code behind. I did not create it from any templates, I just want a very simple site with a couple little pages but I would prefer to do it in c#. Is there something in the web.config (which is also minimal) that would tall Visual Studio that this is a C# site? This is all done via FTP/Remote.

Related

What should be correct approach/template for making anjularJS application within visual studio which will consume C# Web API from the same solution?

I tried some approaches where First, we can install node.js and create a separate application and can externally consume API create in C#.
Second, i downloaded template from below path,
https://github.com/angular/quickstart
imported it to in VS2015 as guided in below link,
https://code4developers.com/angular-4-application-with-visual-studio/
But still i am confused what should be the correct approach to create angularJS project in visual studio 2015 which will occupy web API within same solution.

opening an existing old asp Web Site with DB for modification

I am NOT new to programming however new to c#, asp, and visual studio. For my course project I have to take a seniors existing code and add some more functionality to it to demonstrate my ability in Software Maintenance.
Bug Tracking or is my project and I have to select from two different project however they are old Web Site template and NOT Web Application.
Found a way to open them now I just help with basic SQL settings
all numbered images
Refer to picture and then read please. 2 sub-folders in the project folder, once contains code and the other contains DB files (Pic# 1-3). Pic-4 shows the SqlConnection ctor and Pic-5 is my problem.
Both project appear to be the web forms template, and appear to be the web site template approach, which doesn't have a CSPROJ or VBPROJ file for the project. If there is a solution, you can open it from there. So use Visual Studio or the web developer express tools, which are free.

adding C# objects to a VB web project in Visual Studio 2012. Getting C# templates?

I'm not sure how I was able to do this before in VS 2005, but I recently migrated a VS2005 VB web site to a VS 2012 Web Solution/Project. The solutoin already has both VB and C# Classes in seperate folders and is working. I now want to add a global.asax, but in C#. When I attempt add new item I can't seem to get to C# templates from Visual Studio.
And thinking forward, will I be able to slowly turn my VB solution into an all C# solution Page by Page?
You can freely mix match VB and C# in a Web Site, not in a Web Application. So if you want to continue with that freedom, you'll have to stick with Web Site Projects.
IMHO the decision to migrate from VB to C# can be done either way - slowly in web sites by mixing, and/or really going for it and "forcing" yourself to do C# only in an Application Project.
Hth...

converting a project based solution to projectless website asp.net

I have a rather large Web Application that I began to create using the "Web Projects" solution type in Visual Studio.
I now have a need to incorporate some legacy VB.NET into the application, but low and behold you cannot mix languages using the "web project" model. I have to use what is referred to as projectless development (which is basically just a single folder for the entire website).
Any idea on how I can covert a project to a projectless model?
I hope this makes sense...
Creating a web-site from a web application is relatively straight forward.
Open a new instance of visual studio
File > New Website
Select the folder that has your web application.
Visual studio will warn you that there is already a website containing files at that location.
Select Create a new web site at the existing location.
It will warn you that some files like Default.aspx exist. Choose not to replace them.
And you are done.
The reverse, creating a web application from a web site is difficult. So be sure before you make the change.

Properly using file Designer Files in ASP.NET Web Sites

I need to get existing web pages into an existing ASP.NET web site project in Visual Studio 2008. I simply tried to drag and drop the whole file folder content into the Visual Studio Solution Explorer or even to copy them into the web site folder.
Both ways, Visual Studio seems unable to map the .designer.cs files to the corresponding .aspx (or .master) file, even after restarting the whole IDE. The Solution Explorer entry looks in a way like this:
- Main.aspx
Main.aspx.cs
Main.aspx.designer.cs
Can I make Visual Studio file the designer-file below the aspx-file in any way? I strongly hope there is a simpler way than manually creating each file and copying and pasting the contents into each file by hand.
It sounds like you are trying to bring web application files into a web site. IIf that is the case, The designer files are not even needed. Just dont include them. They are generated and compiled in at runtime when the website runs.
Kind of partially self-answering my question:
In a web project - in contrast to a web site - it works perfectly through drag and drop onto the solution explorer, as I did for the web site before. To make the decision which type of "web site unit" to use there is another thread here on stackoverflow: ASP.NET Web Site or Web Project.
In a web site I can't even use YonahW's solution, because I can't just put files into the proper web site directory without causing them to be added to the web site automatically. Thanks to you anyway, YonahW. :-)
try copying the files through the filesystem and then right clicking on the project and selecting to add an existing item at which point you can choose all at once and this usually puts them in the proper places.

Categories

Resources