MVC Razor GUI and Coder Working Together - asp.net-mvc-3

I would really like to use the MVC and Razor technology for my web application. The problem I am running into is that I am the coder and will be working with a HTML GUI designer.
I only see 2 ways for the GUI person to work at this point.
Install Visual Studio and open the whole solution and work like I am working, except he would stick to the CSHTML files.
Use his favorite HTML editor or notepad and edit the CSHTML files manually and then also have something like IIS Express installed with the app configured so that they can refresh the page they are working on.
Neither of these seems productive or intuitive. I would love to see the GUI person able to use a tool like Expression Web or other tools that allow you to see the design and html at the same time. Having tools available for shading and colors and positioning would be good.
Now I understand why it is this way. It is because of the processing that Razor does to render the pages. This is most true by the fact that most of the cshtml pages themselves are not complete pages. They are meant to live inside of a _layout page.
Isn't there something, though, that can at least show the basic rendering during editor?
What are other people doing?

You have a few options. AFAIK there is no WYSIWYG HTML editor that understands Razor. So, either your designer must work in straight html, or...
1) The designer works in pure HTML files. They give you those files, and you adapt them to Razor. If they need to make changes, you can track those changes with a diff tool (from the previous version) or use a version control system to compare versions of the raw html. Then you apply those changes to your Razor files.
2) Your designer works in .aspx files, which Expression Web understands. You could convert the WebForm syntax to Razor syntax. Again, you are spent doing lot of work, but probably less work than the pure HTML way of doing things, because the designer will have designed the code for master pages. These can be relatively easily adapted to Layouts.
It would be nice if the next version of Expression understands Razor.

Related

Apply theme to Classic ASP website?

One client asked about their website which was developed in Classic ASP with JavaScript and VBScript. I have very limited knowledge about Classic ASP because I have been doing ASP.Net all my life.
My question is, is it possible to change the theme for the website without having to touch any of the programming part? I mean only the interface/look of the website by using any ready template theme like themeforest or else.
I hope anyone here can advice me about this.
This is generally done using Include files that write HTML for headers, footers, navigation, etc. Create a sample HTML file that draws the look you want for your ASP Web App and leave a placeholder in the content area where already-existing content should go. Then split up the area before the existing content (theHead.inc) and after (theFooter.inc), and use Include in all files to place the HTML before and after the content, respectively.

Microsoft Web Matrix

Pretty easy question I hope: does anyone know of a tool that will effectively scrape sites built with Microsoft Matrix? I could write the code in python, but it will take me way longer than I think I want to dedicate to the task, namely because of the really bad and ugly HTML generated by Matrix.
I have tried Web Harvey, Helium Scraper, and I tried the Web Scraper plugin for Chrome. WebHarvey choked on the HTML and couldn't load subsequent pages. Helium Scraper was able to move from one details page to another (the Next links were followed) but content from within the details pages was not lifted out. The Chrome plugin web scraper was not able to navigate links, with the popup window displaying an error page. My gut is telling me that this has to do with uniquely ASP.net things, but I could be wrong.
Any pointers or suggestions appreciated.
You know there are two completely different versions of Microsoft Web Matrix right? There's the one from 2003; i have no idea what its html looks like. There's the one from 2011 to current which uses razor cshtml source files to produce its html. In the 2011+ one, you write the html by hand; there's no drag and drop, and so it's unlikely you'll get consistent html from site to site.

Design View for ASP.NET MVC3 Views

Is there a Design View in ASP.NET MVC3 ?
There is no 'Design' view in MVC, like there is in Forms. However your views are just HTML so you can use any HTML editor, although they will not be able to interpret the Razor syntax.
What most people do is make changes to the HTML, save (you don't have to recompile,) and refresh your browser. Google Chrome has a very help full tool built in (Firebug or something like it.) Just right click on the page and select Inspect Element. This will come in very handy.
Also one thing to think about since you're new to MVC is that you can easily use most any css themes that you can find online to make the site look very different out of the box.

sharepoint webparts, Swap image on click

I'm working on sharepoint project, i have like 1000 image i want to upload, i need webpart or something to do swap images on click, is there any web part that do this?
what the best method to use on my situation.
Are you a SharePoint developer? If not, I'd strongly suggest not even trying to do this. Modifying SharePoint beyond out-of-the-box options requires some extensive asp.net and SharePoint-centric developer skills. Even then, it's not a joy to work with.
In the past, for modifying UI interactions, I found the saner approach is to manipulate the DOM post-render. Load up jQuery and then upon page render, do your thing.

Is there a way to prevent Visual Studio 2010 formatting C# code in ASP.NET MVC views?

I'd like Visual Studio to continue automatically formatting my .cs files, but is there a way to prevent it auto-formatting C# code in between the <% %> tags in ASP.NET MVC views because it really makes a mess of it?
As far as I know there isn't a way to turn off the formatting just in ASP.NET files as it uses the rules for C# in Tools -> Options -> Text Editor -> C#.
There is no way to do it and it is a huge time waster fixing up the formatting in .aspx pages over and over again. It drives me nuts.
There are two connect issues/bugs for this. One was marked as fixed for months but the latest response does not look like anything was even done.
https://connect.microsoft.com/VisualStudio/feedback/details/514691/add-aspx-or-inline-c-as-an-option-in-text-editor-formatting-options
https://connect.microsoft.com/VisualStudio/feedback/details/586729/support-c-formatting-options-for-aspx-pages
Unfortunately (afaik), you can't have separate settings for C# in .cs and .aspx files. You can change the settings for C# in Tools -> Options -> C# -> Formatting.
To get things to work well with MVC, I changed some settings in the New Lines section. I unchecked the boxes for control block, object initializers, and "else". This produces the walk-like-an-egyptian style braces that works best in MVC code, without screwing too much with my normal C# code. I leave the settings for functions, classes etc. alone since you don't normally define those in an .aspx file.
You may consider using Razor as your View Engine instead of aspx.
see also:
http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx (Scott Guthrie)
ASP.NET MVC Razor view engine (StackOverflow)

Resources