Exactly the same content atom feed format in .asp and .aspx: One working, one is not. Why?

StackOverflow https://stackoverflow.com/questions/21430136

  •  04-10-2022
  •  | 
  •  

문제

I am currently trying to implement an atom feed for my Umbraco website (The question is not Umbraco specific, please don't tag with 'Umbraco'). For testing purposes I've copied an atom feed that I found on the web (please don't tell anybody, it's probably illegal) and pasted the content inside a page template. The resulting output is an .aspx - page, which contains nothing but the pasted code:

Not working on aspx - page

As you can see, it is not working, the feed is shows as text, no subscribe options and the like. Accessing the feed with a C# atom API yields an exception, saying the feed type cannot be determined.

Now I've taken the exact same content and pasted it inside another file, this time with the ending .asp, which you can see here:

Working on asp - page

It works. It also works when I rename the file ending to .htm, .html or .xml.

My questions (I've got two) (thanks in advance):

a) Are atom feeds generally not working when the file ending is .aspx? b) How can I provide an atom feed on an .aspx site, when I can't change the file ending?

도움이 되었습니까?

해결책

Ok, found it thanks to this question:

SO Thread

There were blank lines on top of the document in the .aspx file...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top