Visual Studio Web development - removing code duplication - visual-studio

I am developing a basic .html website using visual studio. I am wondering on how other people find this experience. I do not really want to replicate the navigation, header, footer code in each page so what do you use?
I was thinking I might have to use master pages and aspx, unfortunately masterpages and .html do not go. In dreamweaver there used to be templates you could use for each section, which get parsed in when you display the website. I also know there may be various server-side workarounds but I am not really interested in that.
So, how do you cope? Are there any visual studio plugins I should know about?

Master pages is what you want. If you're using Visual Studio, just switch to aspx pages. They're no different than HTML as far as markup is concerned, so you'll be able to move your html to them easily.

Related

Web development in Visual Studio (not ASP.NET) - Is it possible?

I've wondering if it's possible to use visual studio (2013) to develop a HTML5 based website (HTML5-CSS-jQuery-etc), like Dreamweaver (which I hate by the way). Working with MVC Views was so easy because of IntelliSense, so that's why basically asking this. I want make a webpage, but the only option is ASP.NET...
For all those who are going to ask: Yes I've searched about this, but all the tutorials were about ASP.NET
Visual Studio 2012+ offers built-in support for HTML5 as explained in this article: http://msdn.microsoft.com/en-us/magazine/jj618298.aspx. You can create an empty web site and write your code/markup in it.
For the earlier 2008-2010 versions there is a VS extension:
http://visualstudiogallery.msdn.microsoft.com/d771cbc8-d60a-40b0-a1d8-f19fc393127d

Visual Studio 2013 breaking Web Site

I have a really weird problem, be interested in some pointers
We have a website that we have coded from Visual Studio 2003 -> Visual Studio 2010. We are now looking at moving to 2013.
The website is in IIS, when I navigate to it using IE it works. When VS2013 is -open-, not running, but has the project open we get a weird effect where the contents of the website gets duplicated by 3, its as if there are 3 iframes on the page, all with a copy of the same web site.
I close VS2013 and it goes back to normal
So, just to be clear, we don't even have to run the web site from within VS2013, just the project being open is enough to cause the weird effect
We use subversion as as far as I can tell no files have been modified when VS2013 is open
Any suggestions?
Thanks
It's Browser Link that's doing it! If you switch off Browser Link it works.
The source shows some extra script entries before the final tag but other than that the whole source is duplicated.
We don't need Browser Link and I don't have reflection capabilities on Asp.Net source so as to why that's for some one else to determine, I noticed a few people complaining when I searched on it so it may be something that just gets fixed in a future version

Can ReSharper properly parse SharePoint layouts?

I am creating a SharePoint 2010 feature in Visual Studio 2010.
While ReSharper is a valuable tool for writing code, it reports lots of errors (all server-relative image references, master page reference, ContentPlaceHolderID's referring to the master page and so on) in .aspx layout definitions. I had to exclude the master page from ReSharper completely, as it was hanging the VS process - however, the errors were reported before as well.
Is there a 'clever' way of configuring it to correctly parse those files?
As mentioned earlier, R# has offers no support for SharePoint Application- and MasterPages. The issue is because SharePoint is using an other approach to reference assembies and because of the SharePoint specific implementation of the ASP.NET virtual path provider. So R# isn't able to locate all the required dependencies which are required to render an entire SharePoint site.
JetBrains will have to reproduce the SharePoint Designer behavior.
Thorsten
ReSharper 7 (still in beta) supports SharePoint now. ReSharper 7 understands SharePoint-specific master pages, resources, style sheets and JavaScript files.

Prototype / Scriptaculous intellisense in Visual Studio

How do I get intellisense for Prototype / Scriptaculous like we get for jQuery in Visual Studio?
It's certainly not perfect, but you can get a little bit by adding
/// <reference path="path/to/prototype.js" />
to the top of your JavaScript files. Actually, if you have a JS file open in Visual Studio and you drag the prototype.js file into your open file, it will automatically add that reference for you.
This will give you very poor IntelliSense support, but perhaps it is better than nothing.
I might be wrong but I really doubt there is any for now.
For now, either you write your own and share with the world or wait for someone to create them.
PS: jQuery intellisense support was released as a hotfix for VS.NET. It makes sense as jQuery is sort of 'endorsed' by the MS guys. Chances for them to release similar support for other JS framework is unlikely I'll say.

VS.net 2008 issue with asp.net pages

I am having problem in using the source view of an asp.net page in VS.net 2008 IDE. I am not using Design view at all. IDE hangs a bit every now and then, when I use intellisense in it, and I scroll the page.
Please throw some light on it.
Such issues doesnt come up while editing the HTML page, and while editing same asp.net page with the HTML editor which can be configured using Tools -> Options menu option.
Read this Post
This might help to make your visual studio a bit faster in general. I am not very sure about the exact reason for the behavior you mentioned of your Visual Studio.
I suspect that it has something to do with Graphical Interfaces like Toolbox etc.
Thanks
I've had problems like that with Visual Studio before. The intensity of the problems seem to multiply exponentially as the size of the file I work with gets larger.
Here's what I'd reccomend:
Check and make sure Visual Studio is fully updated (Help > Check For Updates) ; there have been some patches released and they will help you immensly!
If your code has any breakpoints, disable them all and start afresh later (Debug > Disable All Breakpoints)
If that fails, here are some more optimizations you can try.
In my case, I think longer file is the culprit. I think partial page concept should be applicable to asp.net page too.

Resources