by StoneJunction
10. January 2012 03:56
If you stop the debugger in a MVC controller and have a dig down in ViewEngines.Engines you will find a property PartialViewLocationFormats

When using @Html.Partial(“{_YourView}”) razors view engine looks in the 4 default locations. The {0} represents the view name and {1} is the controller name.
If you move your partials to a different directory you will get an error screen as it can’t find the file on the default paths its loading. To work around this you can set your own custom ViewEngine with the the paths to your specific location. So for example if you were storing the partials in /Partials then you would use:
public class MyViewEngine : RazorViewEngine
{
private static readonly string[] NewPartialViewFormats = new[]
{
"~/Views/Shared/Partials/{0}.cshtml",
};
public MyViewEngine()
{
base.PartialViewLocationFormats = base.PartialViewLocationFormats.Union(NewPartialViewFormats).ToArray();
}
}
And then in the global.asax.cs you would call it at startup:
protected void Application_Start(Object sender, EventArgs e)
{
ViewEngines.Engines.Add(new MyViewEngine());
}
by StoneJunction
6. January 2012 23:58
I am just getting up to speed on MVC3 with Razor and when creating a partial view ("_TestPartial.cshtml") and including it on another page through with:
@Html.RenderPartial("_TestPartial")
I got the error:
CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
Looking at RenderPartial it returns a void. Internally it writes directly to the response. A quick razor syntax change to:
@{ Html.RenderPartial("_TestPartial"); }
sorted the problem. Now for the interesting problem of getting MVC partials to render on classic aspx webpages.
by StoneJunction
7. December 2011 19:05
Having had my Kindle 3 almost a year I notice that the corners of the screen had developed hairline cracks that spread across the casing. A bit of googling proved that it is a common problem so I gave their UK number a call on 0800 496 2449 expecting either no answer (it was 11.15pm) or a fight over if I had dropped it (I hadn't and it has been in its case all the time).
Absolutely none of that though. I got straight through and within 2 minutes one was on the way which arrived within a day in the post. Excellent customer service Amazon!
My only gripe was that I had to transfer all my books over one by one but that was a little easier as I used the https://www.amazon.co.uk/gp/digital/fiona/manage#Books page.
If only everyones customer service was like this.....I'm looking at you 3 network....

To reset the Kindle you can deregister it here https://www.amazon.co.uk/gp/digital/fiona/manage#manageDevices . Then go into Menu > Settings > Menu > Reset to Factory Defaults. (Note the Menu is pressed after going into settings to ge this option).