How can I use Vash and Razor at the same time? - asp.net-mvc

I'm developing an application with ASP.NET MVC, in my view I'm using Razor as a template engine for my server side code. I was searching for a template engine for my client side code and I found Vash. as you probably know Vash has a pretty clean syntax like Razor.
I am just curious if it is possible to use both of them in the same view file?

Related

How to convert code that written in traditional asp.net way to asp.net MVC

I am working on project that manage inventory.
I have written it on simple asp.net way means I add element on .aspx file and backend code write in c#.
But now I want to convert it to MVC.
Easy: You need to learn asp.net MVC!

DevExpress ASP.NET - Want to use Razor without MVC

I test the DevExpress (DX) ASP.NET
I want to make website with DX and Razor view.
When I create a new Web Project. I can choose between :
DXperience v12.2 ASP.NET Web Application
DXperience v12.2 ASP.NET MVC Web Application
In the choice 1, I can't choose the view language, Visual Studio create an ASPX website.
If I choose MVC, in the creation wizard, I can choose Razor or ASPX.
My question is can I create a website using Razor view without the MVC ?
I don't know the MVC pattern and be affraid to learn it now, I don't understand the logic inside it...
Depending on what you are specifically looking to do, you should check out RazorEngine - it lets you render HTML from Razor without alot of the scaffolding that you will have to do in order to use Razor like MVC uses Razor...

Asp.net MVC3 working on razor as well aspx view engine in parallel

I wanted to convert my views from aspx view engine to razor as we moving forward with new version of MVC, but it is hard to convert everything in single stretch as it is really huge,
is it possible to do it in parallel.
I mean does MVC allows to have few razor views as well as well aspx views and run with out any issues?, or what would be the work around?
Thanks in advance
Yes, the MVC does allow you to mix ASPX views and Razor views on one project.
The framework is very flexible. I've been involved with a couple sites using both aspx and Razorviews. The reason was ALWAYS that they were moving from one to another.
In these cases the aspx pages were not mass changed. New pages were universally Razor and aspx pages were only converted when serious work or re-work was already being done to them.
Followup
there are many aspx to Razor converters. I don't recommend this approach but be aware this is Microsoft's app for convertion.
http://visualstudiogallery.msdn.microsoft.com/d2bfd1ca-9808-417c-b963-eb1ea4896790
Have you tried http://razorconverter.codeplex.com/ ?
It looks promising.
It had some issues with included controls a time ago, but I'm not to updated.

Side-by-Side Asp.Net and MVC Razor

We have an existing ASP.Net Web Application. I would like to create an ASP.Net MVC Razor Application where the two applications will work together. A single Master Page would contain menu items that can call .aspx pages as well as Razor .cshtml pages.
I have seen an example using MvcContrib Portable areas utilizing Routing. This particular example has .aspx pages in both (the MVC was not Razor).
Is there an example out there that will show the two running side-by-side and the MVC is Razor? It would be best if I could download a visual Studio Solution so that I can run this.
I am not sure if the MvcContrib way is the latest and best way to achieve this.
I do not want to go Hybrid!
You don't need any other external librarry. You can always convert the existing ASP.NET web forms Project to be a Hybrid one which uses webforms and MVC. You need to add the required MVC assembly references and make some changes to the web.config and you are all set. Scott has a simple and awesome blog post about this where he explains how to do the conversion.
I scribbled a note about how to enable the MVC specific Context menu( Add Controller / Add View) in the hybrid project after conversion here

SiteMapPath using MVC 3 Razor

I'm currently converting a project from Asp.Net MVC 2 to MVC 3 and I'm having trouble finding out how to do this...
asp:SiteMapPath ID="SiteMapPath1" runat="server"
using Razor?
I've been playing with #SiteMap but other than getting the current node #SiteMap.CurrentNode.ToString() I'm having trouble finding a way to get the path.
Unfortunately, razor does not support the notion of controls. You need to use the good old webforms engine for this or wrap it in a html helper function.
I found a solution that shows how to use the #SiteMap sytax in Razor View :)
here

Resources