简体   繁体   中英

Loading content from DB to aspx page based on URL

I'm currently trying to create a small scale CMS for my personal website and thought I'd like to try to make some sort of a page layout from a basic aspx file with some placeholders and load content based on the URL, without the use of url query strings such as ?pageid=1 .

I'm trying to wrap my head around how this can be achieved without getting errors of a physical file not existing when I eg type in http://mywebsite.com/projects/w8apps/clock .

I've read a lot about BLOB and storing files binarily in the database. But I haven't come across a blog which points in the direction of using a so called page layout and loading content based on the URL instead of a query string.

I'm not asking for a solution, just some hints - blogs mostly - which can point me in the right direction and help me achieve this goal.

To deal with loading a page with a URL that is more friendly, rather than ?page_id=1, you may want to have a look at this article about URL Rewriting and URL Mapping.

http://www.codeproject.com/Articles/18318/URL-Mapping-URL-Rewriting-Search-Engine-Friendly-U

Hope you can find a way of fitting this kind of code into your application!

You questions is too broad but here are couple hints that will point you in the right direction.

  • Create clear specs before you start working on this. Do you really need to have URLs like this http://mywebsite.com/projects/w8apps/clock ? If yes then check out MVC since it has best support for this

  • Storing binary files in database doesn't have much to do with this. You first need to think of how your tables will look like and that is based on what are you trying to achieve…

I'd suggest you install some CRM that if open source and analyze this first. You'll probably find a lot better ideas this way. Just go to CodePlex and search for CMS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM