Umbraco 7.3 adding whitespace at the top of pages - prevents XML/RSS working
Hi All,
We've just upgraded to Umbraco 7.3 from version 7.2.8 and have hit a problem.
On code which previously worked perfectly well we're now getting additional white space at the top of each page. Whilst this isn't an issue for most pages, for those which have templates to create RSS and XML it is.
UPDATE: This appears to be happening on all source returned by 7.3.
This leads me to believe this issue is with either Umbraco 7.3 or the way in which 7.3 works with MVC5.
If other people with 7.3 could confirm/deny that they also get a blank line for line 1 when viewing page source that would at least help ensure I can list this as a bug.
If other people with 7.3 could confirm/deny that they also get a blank
line for line 1 when viewing page source that would at least help
ensure I can list this as a bug.
Hehe, the page you're refering to (https://our.umbraco.org/contribute/releases/730) uses a masterpage instead of a view, so that's not related.
Have you tried Steve's suggestion of putting it right after the closing brace? Seems to work for me and that's how it always worked as far as I can remember:
Yep I tried all that Sebastiaan, the best I could ever get was one blank line prior to code appearing (naturally this was one of the first things I tried). I even resorted to opening the template in a binary editor to ensure there was no white space in it.
Umbraco 7.3 adding whitespace at the top of pages - prevents XML/RSS working
Hi All,
We've just upgraded to Umbraco 7.3 from version 7.2.8 and have hit a problem.
On code which previously worked perfectly well we're now getting additional white space at the top of each page. Whilst this isn't an issue for most pages, for those which have templates to create RSS and XML it is.
UPDATE: This appears to be happening on all source returned by 7.3.
E.g.
In 7.2.8 returns:
In 7.3 returns:
Does anyone know how we can fix this?
Even putting:
dog
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{Layout = null;}
in 7.3 =
Ideas on a postcard please folks!
BTT - any ideas from the morning crowd?
Is this something to do with 7.3 using MVC 5?
We've also tried this method of getting the initial XML declartion at the top of the source returned:
https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/55476-XML-output-from-Template-has-whitespace-at-the-beginning
Unfortunately though it also returns a blank line above the XML declaration.
:-S
Just for completeness I've also tried this: https://our.umbraco.org/forum/umbraco-pro/contour/39079-Razor-code-rendered-as-whitespace
That didn't work either.
Works for me - e.g. no whitespace after the brace } - I've always understood to be the case?
Ok I'm totally confused. I've this tried in a brand new template on a blank page (with no other templates inherited or anything like that) and get:
It's feels like @inherits Umbraco.Web.Mvc.UmbracoTemplatePage is rendering as a blank line :-s
I'd also add that on this very page if you inspect element the you get:
etc
Same applies on this page too (line 1 is a blank line):
https://our.umbraco.org/contribute/releases/730
This leads me to believe this issue is with either Umbraco 7.3 or the way in which 7.3 works with MVC5.
If other people with 7.3 could confirm/deny that they also get a blank line for line 1 when viewing page source that would at least help ensure I can list this as a bug.
Anyone?
We've gone back to 7.2.8 and this issue isn't present, thus the problem is within 7.3+.
Hehe, the page you're refering to (https://our.umbraco.org/contribute/releases/730) uses a masterpage instead of a view, so that's not related.
Have you tried Steve's suggestion of putting it right after the closing brace? Seems to work for me and that's how it always worked as far as I can remember:
Yep I tried all that Sebastiaan, the best I could ever get was one blank line prior to code appearing (naturally this was one of the first things I tried). I even resorted to opening the template in a binary editor to ensure there was no white space in it.
Even with
We still get a blank line for line 1 of the outputted code.
We're at a total loss as to why this is happening :-s
As suspected, it's the same in 7.2.8 , doesn't work unless you put the html/xml on the same line as the closing curly brace.
On our 7.2.8 site we have no issue with this. Just on the 7.3 site. Both are new, virtually empty sites.
When I tested this it was with Visual Studio 2013 so not MVC5... I take it you're using 2015?
VS version doesn't matter. This is all MVC and nothing to do with Umbraco. :)
I was under the impression that only VS 2015 forced MVC 5 - apologies for providing confusion!
is working on a reply...