Yqblog1.0-personal blog system based on ASP. NET mvc3 [Open Source]

Source: Internet
Author: User

Yqblog-personal blog system based on ASP. NET mvc3 ef4.0 technology.

Demo addressThe background management blocks the modification/deletion function by registering and logging for registered user permissions.

[PS: if you have problems attaching or creating a database, try to manually create a yqblog database]

Development Environment
: Visual Studio 2010 (mvc3) + sql2005
Running Environment:. NET Framework 4.0 + sql2005

Website architecture:
Mvc3 + ef4.0 + sqlserver2005 + JSON + XML

Website Structure:
Permission:. Net membership
Classification: category. js (stored in JSON format)
Article content: Table blog_article, blog_articledetail, and view blog_varticle
Configuration information: General. config

Part:

You can use the menu in the upper-right corner to change the language and template.

 

 

Some knowledge points:

JSON
JSON serialization and deserialization are mainly part of the document classification information.

XML
XML serialization and deserialization, configuration information in the General. config section.

Ajax Asynchronization: Jquery and MVC
Submission of comments, display of comments, and recommendation of articles

Jquery
JS in the program is written based on jquery
Some jquery plug-ins used:
Jquery. lazyload. JS: image pre-loading
Jquery. Pager. JS: Paging
Jquery. dragsort. JS: sort by dragging
Jquery. UI. datepicker. JS: Date Control
Jquery. ad-gallery.js: album
Jquery. uploadify-3.1.js: Multifile (picture) Upload

Kindeditor Editor
The Application of kindeditor editor in mvc3 is mainly the transformation of the file (image) Upload part.

Syndicationfeed
Articles and comments RSS

Ninject
Implement dependency injection between the models layer and controllers

Htmlagilitypack
HTML parsing, which is useful in URL submission

Cache
Page cache outputcache and object cache httpruntime. Cache
If you submit an article and find that the homepage is not updated, it is because the page cache is set for 5 minutes by default.
You can modify the configuration at the caching node in webconfig.
<Add name = "cachemain" Duration = "0" varybyparam = "NONE" varybycustom = "roleandtheme"/>

Some functional designs:


Custom URL

You can customize your own URLs,

Before definition:
Http://www.yqhome.net/cate/11
After definition:
Http://www.yqhome.net/mvc/


Custom View

Return view () in the return view statement of the MVC controller returns the view with the same name. Return view ("XXX") returns the view with the specified name. Based on this, the "dependency injection" between the Controller and the view is implemented ". This can be used when some pages require special interface structures or designs.

Globalization, multi-language
Using the built-in resource file implementation in ASP. NET, three versions are available: simplified, traditional, and English.


Multiple Languages and fixed URLs

The area routing function of MVC is used to implement fixed URLs in different languages.
Http://www.yqhome.net/en-us/
Traditional edition: http://www.yqhome.net/zh-tw/
Simplified: http://www.yqhome.net/zh-cn/

Http://www.yqhome.net/point to the language version you specified in background Configuration Management


URL contribution:

If we see a good article in the blog park that we want to repost on our website, copying and pasting will often lead to more or missing node objects. This function writes the structure of commonly used website documents to the configuration file. Next, you only need to copy the URL to repost the article, and the original author and source information will be automatically added at the end of the article.

The function simply implements the class or ID Node object, and does not support complex path searches.
Eg:
[{"Author": "# header1_headertitle", "content": "# cnblogs_post_body", "ID": "1", "name": "cnblogs.com", "title ": "# cb_post_title_url"}]


Custom region [homepage]

You can add friendship links, website announcements, blog calls, and other content. The content of the homepage is always very different. Here, you can customize the content of the homepage through "custom area [homepage. You can also directly write the content to the view, but you can modify and delete the content in real time through the custom area function.

Principle: generate the viewdata Article object corresponding to the ID


Custom region [all network]

The implementation is similar to that of "Custom region [homepage]", but it applies to the whole network. The global filter of MVC is used here. You may be able to use this feature when you need to deploy ads on your website.


Template Switching

MVC can flexibly change the default view path. Combined with the powerful razor view engine. It is easy to implement view pages with the same website but different styles and structures. This should be a great embodiment of the MVC layered model.

Principle: Specify the current view path of the site (blank indicates the default view path of MVC)


Album thumbnail:

Sometimes we may need different Display sizes for an image. It can be defined to generate 0 to multiple thumbnails of different sizes during album upload.
Eg: 200x200,300x300


Decorative chart

Sometimes only text on the page is boring. I have found that many blogs are illustrated, and some are also beautiful illustrations randomly uploaded by the author. This function is implemented.
Operation:
1. Place the image in the decorate folder under Imgae. The name is 1001-1xxx. Default.jpg is the pre-loaded image before the image is delayed.
2. view page call: @ item. Decorate (one of 1001-1xxx is randomly generated, and the adjacent parts are not repeated)
3. If an image is uploaded in the summary of content management, a random decorative image is overwritten.

 

Thank you for reading.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.