Visual Studio 2013 Single-File Mode? - asp.net

I am fairly new to using VS 2013, but I had quite a bit of time in on 2010 version. In VS 2010, working with ASP.NET, I could choose to use a "single file" method instead of the "code-behind" option. This is where the VB code could reside at the top of a page, then the scripting below.
I detest having separate files for code and content, but I cannot find the option in VS 2013 to disable code-behind mode. Did they do away wit this feature?
TIA

This option is only available for websites not web applications, go to File->New->Website and create a new website, then you can choose to have the code behind on the same page or separate page when you are adding new pages.
Keep in mind there are differences between a website and a web application, please investigate further before choosing which project type is suitable for you.

Related

Visual Studio 2022 Enable Web Live Preview

I wanted to try developing a website in VS but I'd really like a visual (WYSIWYG) editor. Apparently, this is available in VS. In that video, and lots of other videos and websites, it shows 'Design' and 'Split' buttons on the window, which should show a live view of the web page that's open. It seems this is supposed to work with both .aspx and .cshtml files.
However, nowhere can I find how to enable this, and I've done a lot of searching. I've even uninstalled and reinstalled VS. There are no options, settings or menu options to enable it. I'm using VS 2022 Community, fully up to date, in an ASP.NET Core Web App project using .NET 7.0.
Does anyone know what's wrong? I wondered if it was only available in VS Professional/Enterprise, but seemed silly to me.
that feature in the brand new vs2022 is for ONLY .net framework, and ONLY for web forms.
So, if you using MVC, then you don't have a forms designer.
And if you using .net core, then you can't use this feature either.
So, when you create a project, it MUST be .net framework (not .net core), and it MUST be a webforms project, and NOT MVC projects.
So, that would be say this (for c#).
And (best choice) would of course be this template:
And if using vb.net, then again, same thing:
So, web projects, and .net framework - NOT .net core projects.
thus:
So, out of those templates, then again, of course a asp.net web application would be the preferred choice.
so, for example, here is a gridview in "live" preview, and yes you can edit or drag + drop controls into that live preview.
it looks like this (split screen for example).
but, if I run the page, same in a chrome based browser (Edge, or chrome).
Then I see this:
Since the new designer is based on the chrome engine then as above shows, yes, it is rather cool.
Here is that web page, not split view in the designer:
(so I have NOT yet hit f5 to run, but only am in design mode)
so, in old legacy designer, I would see/get this:
So, note how do you DO NOT see say for example the bootstrap menu bar.
But, if I turn on live preview, and now I see/get this:
Note how we now even see the bootstrap menu bar in the preview - I have not yet hit f5 to run in browser. And on the bottom, you see a "bread-crumb hierarchy" as to what element you clicked on (very much like f12 debug tools in a browser, and then using "elements" selection).
You can find it by creating an asp.net web (.Net Framework) and selecting Web Form in it.
I use vs2022 17.4.2 community version
You can also view its settings in the tool.

Code Map for ASP.NET Projects in Visual Studio 2013 Ultimate

I need to visualize complex business logic on a single ASP.NET page that has over thousands of lines code so I decided to give Visual Studio's own "Code Map" feature a shot, which is described here: http://msdn.microsoft.com/en-us/library/jj739835.aspx
The tool looks like this:
I tried with VB.NET and C# (including MVC) projects and it was working very well... or that's what I thought, until I tried to use code map tool on an ASP.NET project.
Instead I got this helpful window:
I couldn't find any documentation that says "it's not supported" so I guess I'm doing something wrong? Is there any way to get this tool work, manually trying to add did not help either. I'm open to suggestions.
It appears you're using a File System Web Site Project. These have nebulous support in Visual Studio 2012 and later. I say "nebulous" because I haven't found anything that explicitly states they're deprecated, but the documentation for them is only provided for Visual Studio 2005, 2008 and 2010.
If you need Code Map support for your project, consider converting it to a Web Application.

what kind of asp project was it created with

I am looking to make a change to a web site connected to an SQL server.
as far as I could look at the source files the web page is made in asp with VB (*.aspx, *.aspx.vb, *.ascx, *.ascx.vb - among the file extensions). the issue I am having is that I don't know how was the project created nor which versions were used.
was it a simple web site? or ASP.NET web application? which .netframework version? was it visual studio 2008 or 2010?
the code has no comments anywhere, so it doesn't help me at all.
I tried getting in contact with the previous developer, but he is no longer working in the company. besides the page was created some years ago.
is there a way to recreate the project? anywhere I can look and "guess" which versions I need?
any help is welcome!
Two options.
There is a *.vbproj file among others. This would be a VB.NET VS project file. You can access the project from the VS by opening the project file.
There is no *.vbproj file among others. This would be a VB.NET web site. You can access it by opening it as a "web site" from the VS menu.
The latest version of VS should be able to open any project created with any previous version, in a "worst" case the project would just be converted. I would not be worry about the version of the framework. Plus, if it is a web site, it could be difficult to determine which exact version of VS was used to create it.

How to create a reusable rdlc template?

How to create an rdlc template so that we can use it for all the rdlc files in a project reducing the time to format each and every rdlc file. is it possible to create a rdlc template by which we can have the header to all rdlc files as same as rdlc template by inheriting it??
SSRS for SQL 2008 R2 added some features for using reusable queries (DataSets) and Report headers. The two caveats to this technology is that 1) You can only render these reports via SSRS 2008 R2 (not via the .net reporting controls for Winforms or Webforms), and 2) you need to edit them via Report Builder 3.0 (which requires elevated permissions to SSRS). It will not work with BIDS (VS2008). I have heard that you might be able to edit the new RDLCs by getting an add-on for VStudio 2010 or by using VStudio 2012, but I cannot confirm this.
I usually use a good compare tool, like Beyond Compare, and merge everything from my template into the new report.
It's not that fancy but works. Plus you get a good insight to how reports are defined.
This is usually done through Sub-Reports for Header and Footer.
Is it possible to reuse a header or footer in ReportViewer in Visual Studio 2010?

Is there a setting in Visual Studio 2010 to stop the 'Add New Item' wizard from using server-side code for web forms?

I hate hate HATE that Visual Studio creates .aspx.cs and aspx.designer.cs files every time I add a new .aspx page to my project.
I've searched high and low. How do I turn this off?
There used to be a little checkbox right on the wizard that allowed you to say whether you wanted server-side code pages or not. VS 2010 appears to have removed it.

Resources