开发者

Updating a section of a page to show "News" (Without using a database) Asp.net C#

开发者 https://www.devze.com 2023-03-17 11:22 出处:网络
I want to have a news section to my page in a pla开发者_StackOverflowceholder which can be updated relatively frequently with just Text and a Date.

I want to have a news section to my page in a pla开发者_StackOverflowceholder which can be updated relatively frequently with just Text and a Date.

But I do not want it to be linked to a Database, Is there a way this can be done?


If you are not prepared to use a Database, keep it as static content. Another option would be to use a simple text or xml file and read this in.


You could save the news as an RSS file (simply an XML file format suited for news) and then parse and display it in asp.net.

Here's a tutorial to get you started:

http://www.codeproject.com/KB/XML/RSSFeedEx.aspx


You could try using RSS feeds, example here


If by not linked you mean not bound, yeah. Use ajax to fetch news on a specified interval and append them to your element at client-side. If you're not talking about binding, then you need a news source which could be:

  1. An RSS feed
  2. An XML document
  3. A database
  4. A flat text file
  5. An Excel spreadsheet

and more sources, in which you have to someway write the code to fetch the information and update the UI. That's inevitable.

0

精彩评论

暂无评论...
验证码 换一张
取 消