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