SiteMapPath using MVC 3 Razor - asp.net-mvc

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

Related

How can I use Vash and Razor at the same time?

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?

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.

Does MVCContrib support MVC4?

Does MVCContrib support MVC4? I am trying to use it in my project. Can any one help me with an example?
Does MVCContrib support MVC4?
No.
The documentation mentions support for the script and style bundling of MVC4. Other discussions on codeplex indicate that T4MVC in MVC4 is working for people.
https://t4mvc.codeplex.com/documentation
Support for MVC's script and style bundles
Starting from MVC4, one can define "bundles" of scripts and
stylesheets which are automatically combined and minified. However,
magic strings are used to define the resource URLs. To eliminate them,
follow steps 1 to 3 below.
It appears full support for this is still being added. But the features that worked in MVC2 I know still worked in MVC3 because I used them in MVC3; but the documentation does not explicitly say it works with MVC3. I suspect that every feature in MVC4 that was part of MVC3 still works in MVC4.
Here is the reference discussion for bundling:
http://t4mvc.codeplex.com/discussions/399205
T4MVC is still better than relying on magic strings to reference controller actions and view names. In my opinion the next version of MVC just needs to include T4MVC in the base feature set. Until that happens I'll continue to use T4MVC.

MVC3 .Net + ExtJs 4

I need to know if it is possible to work with ExtJS 4 components like Grid, Combobox, etc., in the Razor Views of MVC 3 .Net. If it is possible, I'd also like to know where I can read a manual/tutorial or some documentation on this.
Here's a tutorial on ExtJS4 Combo & ASP.NET MVC3:
http://whatisextjs.com/extjs-4-tutorial/extjs4-combo-asp-net-mvc3#more-452
Sure it's possible, the Razor views will just generate normal HTML pages, so anything you can do in normal HTML, you can do in ASP.NET MVC.
P.s. check out Ext.NET, a ExtJs library for .NET. Perhaps you find it useful: http://www.ext.net/.
You can use extjs grid in mvc.
mvc - grid sample
http://nraykov.wordpress.com/2009/11/29/using-ext-js-grid-with-asp-net-mvc/
check this also Returning data from ASP.net to an ExtJS Grid

Upgrading ASP.NET MVC2 project to MVC3 and using mixed View Engines

Can I upgrade my MVC2 project to MVC3 and continue to use my ASPX views, AND at the same time start writing some new views in Razor?
More specifically, Can I take an ASPX view page, and a Razor control in it? Would such a thing be possible?
Any other things one should look out for?
You can definitely mix view engines across totally separate views. As for putting Razor "controls" in an ASPX page, if you use RenderPartial, it should work.
One thing I would watch out for is that if you use Master Pages then you may end up duplicating them for both view engines. I had a good ol' WebForms Master Page, used by all my regular .aspx content files, but creating a new view using Razor means I have to use a duplicate Razor layout page alongside that old Master Page.
I haven't looked into it too much, but at first try I get 'The file "~/Views/Shared/Site.Master" could not be rendered, because it does not exist or is not a valid page.' and certainly there's nothing in Scott Gu's blog entry introducing Razor to suggest you can combine them, but I could be all wrong here.
http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx
For how to mix view engine master pages...

Resources